feenox-1.1/ 0000755 0001750 0001750 00000000000 14773607300 007647 5 0000000 0000000 feenox-1.1/AUTHORS 0000644 0001750 0001750 00000000170 14773607165 010646 0000000 0000000 Main author is Jeremy Theler.
Contributions from
Esteban Pellegrino
Juan Pablo Gomez Omil
Ramiro Vignolo
Pablo Camusso
feenox-1.1/README4hackers 0000644 0001750 0001750 00000043514 14773607201 012103 0000000 0000000 FeenoX for Hackers
- 1 Why
- 2 How
- 3 What
- 3.1 Design
- 3.2 Performance
[1 Why]: #why
[2 How]: #how
[3 What]: #what
[3.1 Design]: #design
[3.2 Performance]: #performance
Why
Why is FeenoX different from other “similar” tools?
To better illustrate FeenoX’s unfair advantage (in the entrepreneurial
sense), let us first consider what the options are when we need to write
a technical report, paper or document:
-----------------------------------------------------------------------------
Feature Microsoft Google Markdown[1] (La)TeX
Word Docs
--------------------------- ----------- ---------- ------------- ------------
Aesthetics ❌ ❌ ✅ ✅
Convertibility (to other 😐 😐 ✅ 😐
formats)
Traceability ❌ 😐 ✅ ✅
Mobile-friendliness ❌ ✅ ✅ ❌
Collaborativeness ❌ ✅ ✅ 😐
Licensing/openness ❌ ❌ ✅ ✅
Non-nerd friendliness ✅ ✅ 😐 ❌
-----------------------------------------------------------------------------
After analyzing the pros and cons of each alternative, at some point it
should be evident that Markdown (plus friends) gives the best trade off.
We can then perform a similar analysis for the options available in
order to solve an engineering problem casted as a partial differential
equation, say by using a finite-element formulation:
----------------------------------------------------------------------------
Feature Desktop Web FeenoX[2] Libraries
GUIs frontends
--------------------------- ----------- ----------- ----------- ------------
Flexibility ❌/😐 ❌/😐 ✅ ✅
Scalability ❌ 😐 ✅ ✅
Traceability ❌ 😐 ✅ ✅
Cloud-friendliness ❌ ✅ ✅ ✅
Collaborativeness ❌ ✅ ✅ 😐
Licensing/openness ✅/😐/❌ ❌ ✅ ✅
Non-nerd friendliness ✅ ✅ 😐 ❌
----------------------------------------------------------------------------
Therefore, FeenoX is—in a certain sense—to desktop FEA programs like
- Code_Aster with Salome-Meca, or
- CalculiX with PrePoMax
and to libraries like
- MoFEM or
- Sparselizard
what Markdown is to Word and (La)TeX, respectively and deliberately.
Unlike these other FEA tools, FeenoX provides…
- a ready-to-run executable (which uses Autotools and friends to
compile) that reads the problem to be solved from an input file at
run time (i.e. it is a program not a library) designed an
implemented following the Unix programming philosophy:
$ feenox
FeenoX v0.3.317-g893dcd9
a cloud-first free no-fee no-X uniX-like finite-element(ish) computational engineering tool
usage: feenox [options] inputfile [replacement arguments] [petsc options]
-h, --help display options and detailed explanations of command-line usage
-v, --version display brief version information and exit
-V, --versions display detailed version information
--pdes list the types of PROBLEMs that FeenoX can solve, one per line
--elements_info output a document with information about the supported element types
--linear force FeenoX to solve the PDE problem as linear
--non-linear force FeenoX to solve the PDE problem as non-linear
Run with --help for further explanations.
$
- a parser for a syntactically-sugared self-explanatory ASCII file
(passed as the first non-optional argument to the feenox executable)
with keywords that completely define the problem without requiring
further human actions. Since the there is no need to recompile the
binary for each problem, this allows efficient cloud-first workflows
using containerized images or even provisioning by downloading
binary tarballs or .deb packages.
- a few supported PROBLEM types and a mechanism to allow hacker and
academics to add new PDEs (as explained in the next bullet). This
bullet is about the fact that a regular user wanting to solve heat
conduction (even with multi-material non-uniform conductivities)
just needs to do
PROBLEM thermal
and does not need to know nor write the weak form of the Poisson
equation in the input file, since the vast majority of users will
not know what a weak form is (even though other “similar” tools ask
their users for that).
- a Git repository with GPL sources (and CC-BY SA documentation) where
contributions are welcome. In particular, each partial differential
equation that FeenoX can solve correspondens to one of the
subdirectories of src/pdes that provide C entry points that the main
mathematical framework calls as function pointer to build the
elemental objects. The autogen.sh step (prior to ./configure and
make) detects the directory structure and includes all the
subdirectories it finds as available problem types. They can be
queried at runtime with the --pdes option:
$ feenox --pdes
laplace
mechanical
modal
neutron_diffusion
neutron_sn
thermal
$
The decision of extensibility through compiled code is, as the
choice of making FeenoX a program and not a library, a thoughtful
one. See FeenoX for academics for more details about how the
extensibility mechanism works.
- continuous integration (using Github actions), an issue tracker
(using Github issues and a discussion page (using Github
discussions)
- a mechanism to expand command-line arguments as literal strings in
the input file so as to allow parametric (and/or optimization)
loops. For instance, if an input file print.fee looks like
PRINT 2*${1}
then
$ for i in $(seq 1 5); do feenox print.fee $i; done
2
4
6
8
10
$
- the possibility to provide the input from stdin (so as to use it as
a Unix pipe) by passing - as the input file path:
$ for i in $(seq 1 5); do echo "PRINT 2*\${1}" | feenox - $i; done
2
4
6
8
10
$
- flexibility to handle many workflows, including web-based interfaces
and thin command-line clients.
The input file…
- has a one-to-one correspondence with the human description of the
problem
- is Git-traceable (the mesh is defined in a separate file created by
Gmsh, which may or may not be tracked)
- allows the user to enter algebraic expressions whenever a numerical
value is needed (everything is an expression)
- understands definitions (nouns) and instructions (verbs). FeenoX has
an actual instruction pointer that loops over the instruction set
(there might even be conditional blocks).
- is simple for simple files (but might get more complicated for more
complex problems). Remember Alan Kay’s quote: “simple things should
be simple and complex things should be possible.”
Following the Unix rule of silence, the output is 100% user-defined: if
there are not explicit output instructions, FeenoX will not write
anything. And probably nothing will be computed (because FeenoX is smart
and will not compute things that are not actually needed).
[1] Here “Markdown” means (Pandoc + Git + Github / Gitlab / Gitea)
[2] Here “FeenoX” means (FeenoX + Gmsh + Paraview + Git + Github /
Gitlab / Gitea)
[FeenoX]: https://www.seamplex.com/feenox
[Markdown]: https://en.wikipedia.org/wiki/Markdown
[Code_Aster]: https://www.code-aster.org/spip.php?rubrique2
[Salome-Meca]: https://www.code-aster.org/V2/spip.php?article303
[CalculiX]: http://www.calculix.de/
[PrePoMax]: https://prepomax.fs.um.si/
[MoFEM]: http://mofem.eng.gla.ac.uk/mofem/html/
[Sparselizard]: http://sparselizard.org/
[1]: https://commonmark.org/
[(La)TeX]: https://en.wikipedia.org/wiki/LaTeX
[ready-to-run executable]: https://www.seamplex.com/feenox/doc/sds.html#sec:execution
[reads the problem to be solved from an input file]: https://www.seamplex.com/feenox/doc/sds.html#sec:input
[Unix programming philosophy]: https://www.seamplex.com/feenox/doc/sds.html#sec:unix
[syntactically-sugared]: https://seamplex.com/feenox/doc/sds.html#sec:syntactic
[self-explanatory ASCII file]: https://seamplex.com/feenox/doc/sds.html#sec:input
[cloud-first]: https://seamplex.com/feenox/doc/sds.html#cloud-first
[PROBLEM]: https://www.seamplex.com/feenox/doc/feenox-manual.html#problem
[academics]: ./README4academics.md
[regular user]: ./README4engineers.md
[multi-material non-uniform conductivities]: https://www.seamplex.com/feenox/doc/tutorials/320-thermal/
[users]: README4engineers.md
[Git repository]: https://github.com/seamplex/feenox
[GPL sources]: https://github.com/seamplex/feenox/tree/main/src
[CC-BY SA documentation]: https://github.com/seamplex/feenox/tree/main/doc
[contributions are welcome]: https://www.seamplex.com/feenox/doc/#contributing
[C entry points that the main mathematical framework calls as function pointer to build the elemental objects]:
https://seamplex.com/feenox/doc/sds.html#sec:extensibility
[Github actions]: https://github.com/seamplex/feenox/actions
[Github issues]: https://github.com/seamplex/feenox/issues
[Github discussions]: https://github.com/seamplex/feenox/discussions
[expand command-line arguments as literal strings in the input file]: https://www.seamplex.com/feenox/doc/sds.html#sec:run-time-arguments
[parametric]: https://www.seamplex.com/feenox/doc/sds.html#sec:parametric
[optimization]: https://www.seamplex.com/feenox/doc/sds.html#sec:optimization
[web-based interfaces]: https://www.caeplex.com
[thin command-line clients]: https://www.seamplex.com/feenox/doc/sds.html#cloud-first
[one-to-one correspondence with the human description of the problem]:
https://seamplex.com/feenox/doc/sds.html#sec:matching-formulations
[Gmsh]: http://gmsh.info/
[algebraic expressions whenever a numerical value is needed]: https://seamplex.com/feenox/doc/sds.html#sec:expression
[definitions (nouns) and instructions (verbs)]: https://seamplex.com/feenox/doc/sds.html#sec:nouns_verbs
[conditional blocks]: https://www.seamplex.com/feenox/doc/feenox-manual.html#if
[simple for simple files]: https://seamplex.com/feenox/doc/sds.html#sec:simple
[more complicated for more complex problems]: https://seamplex.com/feenox/doc/sds.html#sec:complex
[Alan Kay]: https://en.wikipedia.org/wiki/Alan_Kay
[“simple things should be simple and complex things should be possible.”]:
https://www.quora.com/What-is-the-story-behind-Alan-Kay-s-adage-Simple-things-should-be-simple-complex-things-should-be-possible
[the output is 100% user-defined]: https://seamplex.com/feenox/doc/sds.html#sec:output
[Pandoc]: https://pandoc.org/
[Git]: https://git-scm.com/
[Github]: https://github.com/
[Gitlab]: https://about.gitlab.com/
[Gitea]: https://gitea.com/%7D%7BGitea%7D
[2]: https://seamplex.com/feenox
[3]: http://gmsh.info
[Paraview]: https://www.paraview.org/
How
Feenox is a computational tool designed to be run on Unix servers as a
part of a cloud-first workflow, optionally involving MPI communication
among different servers to handle arbitrarily-large problems:
Check out the section about invocation in the FeenoX manual.
It has been written in C and designed under the Unix programming
philosophy as quoted by Eric Raymond. Following the rule of composition,
when solving PDEs FeenoX works very much as a Unix pipe between a mesher
(such as Gmsh) and a post-processing tool (such as Paraview):
+------------+
mesh (*.msh) } | | { terminal
data (*.dat) } input ----> | FeenoX |----> output { data files
input (*.fee) } | | { post (vtk/msh)
+------------+
FeenoX consists of a binary executable which is compiled using GNU
Autotools (i.e. ./autogen.sh && ./configure && make) and uses three
well-established and open source libraries:
a. The GNU Scientific Library for basic numerical computations
b. SUNDIALS IDA for solving systems of ODEs/DAEs
c. PETSc and SLEPc for solving PDEs
So even more, considering the NAFEMS LE10 Benchmark problem, it works as
two “glue layers,”
1. between the mesher Gmsh and the PETSc library
2. between the PETSc library and the post-processor Paraview
[]
The stock packages provided in most GNU/Linux distributions work
perfectly well, but custom configured and compiled versions (e.g. with
particular optimization flags or linked with non-standard MPI
implementations) can be used as well.
An empty Debian-based GNU/Linux server (either amd64 or arm) can be
provisioned with a working FeenoX binary at /usr/local/bin ready to
solve arbitrary problems by doing
sudo apt-get install -y libgsl-dev libsundials-dev petsc-dev slepc-dev
git clone https://github.com/seamplex/feenox
cd feenox
./autogen.sh
./configure
make
make install
Heads up! If we wanted to be sure everything went smooth, we would
need to take some time to install Gmsh and run the test suite:
sudo apt-get install gmsh
make check
These steps are flexible enough so as to be integrated into
containerization technologies (e.g. Docker files), continuous
integration schemes (e.g. Github actions) or to suit any other
particular needs (e.g. servers with custom PETSc installations or
clusters multi-node MPI communication schemes). For instance, it is also
possible to generate custom .deb (or .rpm) packages and make the
server’s apt manager to fetch and install them without needing to
compile the source code at all.
Following the Unix rule of diversity, different compilers, both for the
C code part of FeenoX as for the code in the dependencies (and their
dependencies) can be used. So far there were tested
- GCC (free)
- Clang (free)
- Intel OneAPI (privative)
Also, different MPI implementations have been tested:
- OpenMPI (free, not to confuse with OpenMP)
- MPICH (free)
- Intel MPI (privative)
Feel free to raise any concerns you might have in our discussions forum.
[cloud-first]: https://seamplex.com/feenox/doc/sds.html#cloud-first
[involving MPI communication among different servers]: https://seamplex.com/feenox/doc/sds.html#sec:scalability
[invocation]: https://www.seamplex.com/feenox/doc/feenox-manual.html#running-feenox
[FeenoX manual]: https://www.seamplex.com/feenox/doc/feenox-manual.html
[written in C]: https://seamplex.com/feenox/doc/programming.html#languages
[GNU Scientific Library]: https://www.gnu.org/software/gsl/
[SUNDIALS IDA]: https://computing.llnl.gov/projects/sundials/ida
[PETSc]: https://petsc.org/
[SLEPc]: http://slepc.upv.es/
[NAFEMS LE10 Benchmark problem]: https://seamplex.com/feenox/examples/mechanical.html#nafems-le10-thick-plate-pressure-benchmark
[“glue layers,”]: https://www.linuxtopia.org/online_books/programming_books/art_of_unix_programming/ch04s03_1.html
[Gmsh]: http://gmsh.info/
[PETSc library]: https://petsc.org/release/
[Paraview]: https://www.paraview.org/
[4]: doc/transfer-le10-zoom.svg
[discussions forum]: https://github.com/seamplex/feenox/discussions
What
FeenoX is a cloud-first back end for generic computational workflows to
solve engineering-related problems:
- Basic mathematics
- Systems of ODEs/DAEs
- Laplace’s equation
- Heat conduction
- Linear elasticity
- Modal analysis
- Neutron diffusion
- Neutron SN
[cloud-first]: https://seamplex.com/feenox/doc/sds.html#cloud-first
[back end]: https://en.wikipedia.org/wiki/Frontend_and_backend
[engineering-related problems]: ./README4engineers.md
[Basic mathematics]: https://seamplex.com/feenox/examples/basic.html
[Systems of ODEs/DAEs]: https://seamplex.com/feenox/examples/daes.html
[Laplace’s equation]: https://seamplex.com/feenox/examples/laplace.html
[Heat conduction]: https://seamplex.com/feenox/examples/thermal.html
[Linear elasticity]: https://seamplex.com/feenox/examples/mechanical.html
[Modal analysis]: https://seamplex.com/feenox/examples/modal.html
[Neutron diffusion]: https://seamplex.com/feenox/examples/neutron_diffusion.html
[Neutron SN]: https://seamplex.com/feenox/examples/neutron_sn.html
Design
- FeenoX follows a fictitious (yet plausible) Software Design
Requirements.
- The explanation of how FeenoX addresses the requirements can be
found in the Software Design Specification.
[fictitious (yet plausible) Software Design Requirements]: https://www.seamplex.com/feenox/doc/srs.html
[Software Design Specification]: https://www.seamplex.com/feenox/doc/sds.html
Performance
- FeenoX’s performance can be profiled and analyzed with the Google
Benchmark library using this repository.
- A rough comparison of FeenoX’s performance (and differences with
respect to problem set up and execution) with respect to other
similar tools can be found in this link:
https://seamplex.com/feenox/tests/nafems/le10/
Check out FeenoX for Engineers and FeenoX for Academics for
complementary information.
[this repository]: https://github.com/seamplex/feenox-benchmark
[FeenoX for Engineers]: README4engineers.md
[FeenoX for Academics]: README4academics.md
feenox-1.1/NEWS 0000644 0001750 0001750 00000000061 14773607165 010274 0000000 0000000 See for news.
feenox-1.1/config.guess 0000755 0001750 0001750 00000140512 14773607171 012120 0000000 0000000 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2022-01-09'
# This file 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 .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to .
# The "shellcheck disable" line above the timestamp inhibits complaints
# about features and limitations of the classic Bourne shell that were
# superseded or lifted in POSIX. However, this script identifies a wide
# variety of pre-POSIX systems that do not have POSIX shells at all, and
# even some reasonably current systems (Solaris 10 as case-in-point) still
# have a pre-POSIX /bin/sh.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
# Just in case it came from the environment.
GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
tmp=
# shellcheck disable=SC2172
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() {
# prevent multiple calls if $tmp is already set
test "$tmp" && return 0
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039,SC3028
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver
break
fi
done
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
LIBC=unknown
set_cc_for_build
cat <<-EOF > "$dummy.c"
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#elif defined(__GLIBC__)
LIBC=gnu
#else
#include
/* First heuristic to detect musl libc. */
#ifdef __DEFINED_va_list
LIBC=musl
#endif
#endif
EOF
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
eval "$cc_set_libc"
# Second heuristic to detect musl libc.
if [ "$LIBC" = unknown ] &&
command -v ldd >/dev/null &&
ldd --version 2>&1 | grep -q ^musl; then
LIBC=musl
fi
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
if [ "$LIBC" = unknown ]; then
LIBC=gnu
fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown)`
case $UNAME_MACHINE_ARCH in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
case $UNAME_MACHINE_ARCH in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# Determine ABI tags.
case $UNAME_MACHINE_ARCH in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
*)
release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
GUESS=$machine-${os}${release}${abi-}
;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
;;
*:SecBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
;;
*:MidnightBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
;;
*:ekkoBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
;;
*:SolidBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
;;
*:OS108:*:*)
GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
;;
macppc:MirBSD:*:*)
GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
;;
*:MirBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
;;
*:Sortix:*:*)
GUESS=$UNAME_MACHINE-unknown-sortix
;;
*:Twizzler:*:*)
GUESS=$UNAME_MACHINE-unknown-twizzler
;;
*:Redox:*:*)
GUESS=$UNAME_MACHINE-unknown-redox
;;
mips:OSF1:*.*)
GUESS=mips-dec-osf1
;;
alpha:OSF1:*:*)
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case $ALPHA_CPU_TYPE in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
UNAME_MACHINE=alpha ;;
"EV5 (21164)")
UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
;;
Amiga*:UNIX_System_V:4.0:*)
GUESS=m68k-unknown-sysv4
;;
*:[Aa]miga[Oo][Ss]:*:*)
GUESS=$UNAME_MACHINE-unknown-amigaos
;;
*:[Mm]orph[Oo][Ss]:*:*)
GUESS=$UNAME_MACHINE-unknown-morphos
;;
*:OS/390:*:*)
GUESS=i370-ibm-openedition
;;
*:z/VM:*:*)
GUESS=s390-ibm-zvmoe
;;
*:OS400:*:*)
GUESS=powerpc-ibm-os400
;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
GUESS=arm-acorn-riscix$UNAME_RELEASE
;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
GUESS=arm-unknown-riscos
;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
GUESS=hppa1.1-hitachi-hiuxmpp
;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
case `(/bin/universe) 2>/dev/null` in
att) GUESS=pyramid-pyramid-sysv3 ;;
*) GUESS=pyramid-pyramid-bsd ;;
esac
;;
NILE*:*:*:dcosx)
GUESS=pyramid-pyramid-svr4
;;
DRS?6000:unix:4.0:6*)
GUESS=sparc-icl-nx6
;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) GUESS=sparc-icl-nx7 ;;
esac
;;
s390x:SunOS:*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
;;
sun4H:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-hal-solaris2$SUN_REL
;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-sun-solaris2$SUN_REL
;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
GUESS=i386-pc-auroraux$UNAME_RELEASE
;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
set_cc_for_build
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
fi
fi
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-sun-solaris3$SUN_REL
;;
sun4*:SunOS:*:*)
case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
GUESS=sparc-sun-sunos$SUN_REL
;;
sun3*:SunOS:*:*)
GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case `/bin/arch` in
sun3)
GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
;;
aushp:SunOS:*:*)
GUESS=sparc-auspex-sunos$UNAME_RELEASE
;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
GUESS=m68k-milan-mint$UNAME_RELEASE
;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
GUESS=m68k-hades-mint$UNAME_RELEASE
;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
GUESS=m68k-unknown-mint$UNAME_RELEASE
;;
m68k:machten:*:*)
GUESS=m68k-apple-machten$UNAME_RELEASE
;;
powerpc:machten:*:*)
GUESS=powerpc-apple-machten$UNAME_RELEASE
;;
RISC*:Mach:*:*)
GUESS=mips-dec-mach_bsd4.3
;;
RISC*:ULTRIX:*:*)
GUESS=mips-dec-ultrix$UNAME_RELEASE
;;
VAX*:ULTRIX*:*:*)
GUESS=vax-dec-ultrix$UNAME_RELEASE
;;
2020:CLIX:*:* | 2430:CLIX:*:*)
GUESS=clipper-intergraph-clix$UNAME_RELEASE
;;
mips:*:*:UMIPS | mips:*:*:RISCos)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
GUESS=mips-mips-riscos$UNAME_RELEASE
;;
Motorola:PowerMAX_OS:*:*)
GUESS=powerpc-motorola-powermax
;;
Motorola:*:4.3:PL8-*)
GUESS=powerpc-harris-powermax
;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
GUESS=powerpc-harris-powermax
;;
Night_Hawk:Power_UNIX:*:*)
GUESS=powerpc-harris-powerunix
;;
m88k:CX/UX:7*:*)
GUESS=m88k-harris-cxux7
;;
m88k:*:4*:R4*)
GUESS=m88k-motorola-sysv4
;;
m88k:*:3*:R3*)
GUESS=m88k-motorola-sysv3
;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
GUESS=m88k-dg-dgux$UNAME_RELEASE
else
GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
GUESS=i586-dg-dgux$UNAME_RELEASE
fi
;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
GUESS=m88k-dolphin-sysv3
;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
GUESS=m88k-motorola-sysv3
;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
GUESS=m88k-tektronix-sysv3
;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
GUESS=m68k-tektronix-bsd
;;
*:IRIX*:*:*)
IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
GUESS=mips-sgi-irix$IRIX_REL
;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
GUESS=i386-ibm-aix
;;
ia64:AIX:*:*)
if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
GUESS=$SYSTEM_NAME
else
GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
GUESS=rs6000-ibm-aix3.2.4
else
GUESS=rs6000-ibm-aix3.2
fi
;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if test -x /usr/bin/lslpp ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
GUESS=$IBM_ARCH-ibm-aix$IBM_REV
;;
*:AIX:*:*)
GUESS=rs6000-ibm-aix
;;
ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
GUESS=romp-ibm-bsd4.4
;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
GUESS=rs6000-bull-bosx
;;
DPX/2?00:B.O.S.:*:*)
GUESS=m68k-bull-sysv3
;;
9000/[34]??:4.3bsd:1.*:*)
GUESS=m68k-hp-bsd
;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
GUESS=m68k-hp-bsd4.4
;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
case $UNAME_MACHINE in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case $sc_cpu_version in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case $sc_kernel_bits in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if test "$HP_ARCH" = hppa2.0w
then
set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH=hppa2.0w
else
HP_ARCH=hppa64
fi
fi
GUESS=$HP_ARCH-hp-hpux$HPUX_REV
;;
ia64:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
GUESS=ia64-hp-hpux$HPUX_REV
;;
3050*:HI-UX:*:*)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
GUESS=unknown-hitachi-hiuxwe2
;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
GUESS=hppa1.1-hp-bsd
;;
9000/8??:4.3bsd:*:*)
GUESS=hppa1.0-hp-bsd
;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
GUESS=hppa1.0-hp-mpeix
;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
GUESS=hppa1.1-hp-osf
;;
hp8??:OSF1:*:*)
GUESS=hppa1.0-hp-osf
;;
i*86:OSF1:*:*)
if test -x /usr/sbin/sysversion ; then
GUESS=$UNAME_MACHINE-unknown-osf1mk
else
GUESS=$UNAME_MACHINE-unknown-osf1
fi
;;
parisc*:Lites*:*:*)
GUESS=hppa1.1-hp-lites
;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
GUESS=c1-convex-bsd
;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
GUESS=c34-convex-bsd
;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
GUESS=c38-convex-bsd
;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
GUESS=c4-convex-bsd
;;
CRAY*Y-MP:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=ymp-cray-unicos$CRAY_REL
;;
CRAY*[A-Z]90:*:*:*)
echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=t90-cray-unicos$CRAY_REL
;;
CRAY*T3E:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=alphaev5-cray-unicosmk$CRAY_REL
;;
CRAY*SV1:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=sv1-cray-unicos$CRAY_REL
;;
*:UNICOS/mp:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=craynv-cray-unicosmp$CRAY_REL
;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
;;
sparc*:BSD/OS:*:*)
GUESS=sparc-unknown-bsdi$UNAME_RELEASE
;;
*:BSD/OS:*:*)
GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
else
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
fi
;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
;;
i*:CYGWIN*:*)
GUESS=$UNAME_MACHINE-pc-cygwin
;;
*:MINGW64*:*)
GUESS=$UNAME_MACHINE-pc-mingw64
;;
*:MINGW*:*)
GUESS=$UNAME_MACHINE-pc-mingw32
;;
*:MSYS*:*)
GUESS=$UNAME_MACHINE-pc-msys
;;
i*:PW*:*)
GUESS=$UNAME_MACHINE-pc-pw32
;;
*:SerenityOS:*:*)
GUESS=$UNAME_MACHINE-pc-serenity
;;
*:Interix*:*)
case $UNAME_MACHINE in
x86)
GUESS=i586-pc-interix$UNAME_RELEASE
;;
authenticamd | genuineintel | EM64T)
GUESS=x86_64-unknown-interix$UNAME_RELEASE
;;
IA64)
GUESS=ia64-unknown-interix$UNAME_RELEASE
;;
esac ;;
i*:UWIN*:*)
GUESS=$UNAME_MACHINE-pc-uwin
;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
GUESS=x86_64-pc-cygwin
;;
prep*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=powerpcle-unknown-solaris2$SUN_REL
;;
*:GNU:*:*)
# the GNU system
GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;;
*:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix
;;
aarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
arm*:Linux:*:*)
set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
;;
avr32*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
cris:Linux:*:*)
GUESS=$UNAME_MACHINE-axis-linux-$LIBC
;;
crisv32:Linux:*:*)
GUESS=$UNAME_MACHINE-axis-linux-$LIBC
;;
e2k:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
frv:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
hexagon:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
i*86:Linux:*:*)
GUESS=$UNAME_MACHINE-pc-linux-$LIBC
;;
ia64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m32r*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m68*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
mips:Linux:*:* | mips64:Linux:*:*)
set_cc_for_build
IS_GLIBC=0
test x"${LIBC}" = xgnu && IS_GLIBC=1
sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef mips
#undef mipsel
#undef mips64
#undef mips64el
#if ${IS_GLIBC} && defined(_ABI64)
LIBCABI=gnuabi64
#else
#if ${IS_GLIBC} && defined(_ABIN32)
LIBCABI=gnuabin32
#else
LIBCABI=${LIBC}
#endif
#endif
#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa64r6
#else
#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa32r6
#else
#if defined(__mips64)
CPU=mips64
#else
CPU=mips
#endif
#endif
#endif
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
MIPS_ENDIAN=
#else
MIPS_ENDIAN=
#endif
#endif
EOF
cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
eval "$cc_set_vars"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
openrisc*:Linux:*:*)
GUESS=or1k-unknown-linux-$LIBC
;;
or32:Linux:*:* | or1k*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
padre:Linux:*:*)
GUESS=sparc-unknown-linux-$LIBC
;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
GUESS=hppa64-unknown-linux-$LIBC
;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
*) GUESS=hppa-unknown-linux-$LIBC ;;
esac
;;
ppc64:Linux:*:*)
GUESS=powerpc64-unknown-linux-$LIBC
;;
ppc:Linux:*:*)
GUESS=powerpc-unknown-linux-$LIBC
;;
ppc64le:Linux:*:*)
GUESS=powerpc64le-unknown-linux-$LIBC
;;
ppcle:Linux:*:*)
GUESS=powerpcle-unknown-linux-$LIBC
;;
riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
s390:Linux:*:* | s390x:Linux:*:*)
GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
;;
sh64*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
sh*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
sparc:Linux:*:* | sparc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
tile*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
vax:Linux:*:*)
GUESS=$UNAME_MACHINE-dec-linux-$LIBC
;;
x86_64:Linux:*:*)
set_cc_for_build
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
LIBCABI=${LIBC}x32
fi
fi
GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
;;
xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
GUESS=i386-sequent-sysv4
;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
GUESS=$UNAME_MACHINE-pc-os2-emx
;;
i*86:XTS-300:*:STOP)
GUESS=$UNAME_MACHINE-unknown-stop
;;
i*86:atheos:*:*)
GUESS=$UNAME_MACHINE-unknown-atheos
;;
i*86:syllable:*:*)
GUESS=$UNAME_MACHINE-pc-syllable
;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
GUESS=i386-unknown-lynxos$UNAME_RELEASE
;;
i*86:*DOS:*:*)
GUESS=$UNAME_MACHINE-pc-msdosdjgpp
;;
i*86:*:4.*:*)
UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
GUESS=$UNAME_MACHINE-pc-sysv32
fi
;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
GUESS=i586-pc-msdosdjgpp
;;
Intel:Mach:3*:*)
GUESS=i386-pc-mach3
;;
paragon:*:*:*)
GUESS=i860-intel-osf1
;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
;;
mini*:CTIX:SYS*5:*)
# "miniframe"
GUESS=m68010-convergent-sysv
;;
mc68k:UNIX:SYSTEM5:3.51m)
GUESS=m68k-convergent-sysv
;;
M680?0:D-NIX:5.3:*)
GUESS=m68k-diab-dnix
;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
GUESS=m68k-unknown-lynxos$UNAME_RELEASE
;;
mc68030:UNIX_System_V:4.*:*)
GUESS=m68k-atari-sysv4
;;
TSUNAMI:LynxOS:2.*:*)
GUESS=sparc-unknown-lynxos$UNAME_RELEASE
;;
rs6000:LynxOS:2.*:*)
GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
;;
SM[BE]S:UNIX_SV:*:*)
GUESS=mips-dde-sysv$UNAME_RELEASE
;;
RM*:ReliantUNIX-*:*:*)
GUESS=mips-sni-sysv4
;;
RM*:SINIX-*:*:*)
GUESS=mips-sni-sysv4
;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
GUESS=$UNAME_MACHINE-sni-sysv4
else
GUESS=ns32k-sni-sysv
fi
;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
GUESS=i586-unisys-sysv4
;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
GUESS=hppa1.1-stratus-sysv4
;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
GUESS=i860-stratus-sysv4
;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
GUESS=$UNAME_MACHINE-stratus-vos
;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
GUESS=hppa1.1-stratus-vos
;;
mc68*:A/UX:*:*)
GUESS=m68k-apple-aux$UNAME_RELEASE
;;
news*:NEWS-OS:6*:*)
GUESS=mips-sony-newsos6
;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if test -d /usr/nec; then
GUESS=mips-nec-sysv$UNAME_RELEASE
else
GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
GUESS=powerpc-be-beos
;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
GUESS=powerpc-apple-beos
;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
GUESS=i586-pc-beos
;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku
;;
x86_64:Haiku:*:*)
GUESS=x86_64-unknown-haiku
;;
SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE
;;
SX-5:SUPER-UX:*:*)
GUESS=sx5-nec-superux$UNAME_RELEASE
;;
SX-6:SUPER-UX:*:*)
GUESS=sx6-nec-superux$UNAME_RELEASE
;;
SX-7:SUPER-UX:*:*)
GUESS=sx7-nec-superux$UNAME_RELEASE
;;
SX-8:SUPER-UX:*:*)
GUESS=sx8-nec-superux$UNAME_RELEASE
;;
SX-8R:SUPER-UX:*:*)
GUESS=sx8r-nec-superux$UNAME_RELEASE
;;
SX-ACE:SUPER-UX:*:*)
GUESS=sxace-nec-superux$UNAME_RELEASE
;;
Power*:Rhapsody:*:*)
GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
;;
*:Rhapsody:*:*)
GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
;;
arm64:Darwin:*:*)
GUESS=aarch64-apple-darwin$UNAME_RELEASE
;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build
fi
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
;;
*:QNX:*:4*)
GUESS=i386-pc-qnx
;;
NEO-*:NONSTOP_KERNEL:*:*)
GUESS=neo-tandem-nsk$UNAME_RELEASE
;;
NSE-*:NONSTOP_KERNEL:*:*)
GUESS=nse-tandem-nsk$UNAME_RELEASE
;;
NSR-*:NONSTOP_KERNEL:*:*)
GUESS=nsr-tandem-nsk$UNAME_RELEASE
;;
NSV-*:NONSTOP_KERNEL:*:*)
GUESS=nsv-tandem-nsk$UNAME_RELEASE
;;
NSX-*:NONSTOP_KERNEL:*:*)
GUESS=nsx-tandem-nsk$UNAME_RELEASE
;;
*:NonStop-UX:*:*)
GUESS=mips-compaq-nonstopux
;;
BS2000:POSIX*:*:*)
GUESS=bs2000-siemens-sysv
;;
DS/*:UNIX_System_V:*:*)
GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
elif test "x${cputype-}" != x; then
UNAME_MACHINE=$cputype
fi
GUESS=$UNAME_MACHINE-unknown-plan9
;;
*:TOPS-10:*:*)
GUESS=pdp10-unknown-tops10
;;
*:TENEX:*:*)
GUESS=pdp10-unknown-tenex
;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
GUESS=pdp10-dec-tops20
;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
GUESS=pdp10-xkl-tops20
;;
*:TOPS-20:*:*)
GUESS=pdp10-unknown-tops20
;;
*:ITS:*:*)
GUESS=pdp10-unknown-its
;;
SEI:*:*:SEIUX)
GUESS=mips-sei-seiux$UNAME_RELEASE
;;
*:DragonFly:*:*)
DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case $UNAME_MACHINE in
A*) GUESS=alpha-dec-vms ;;
I*) GUESS=ia64-dec-vms ;;
V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
GUESS=i386-pc-xenix
;;
i*86:skyos:*:*)
SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
;;
i*86:rdos:*:*)
GUESS=$UNAME_MACHINE-pc-rdos
;;
i*86:Fiwix:*:*)
GUESS=$UNAME_MACHINE-pc-fiwix
;;
*:AROS:*:*)
GUESS=$UNAME_MACHINE-unknown-aros
;;
x86_64:VMkernel:*:*)
GUESS=$UNAME_MACHINE-unknown-esx
;;
amd64:Isilon\ OneFS:*:*)
GUESS=x86_64-unknown-onefs
;;
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
esac
# Do we have a guess based on uname results?
if test "x$GUESS" != x; then
echo "$GUESS"
exit
fi
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <
#include
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include
#if defined(_SIZE_T_) || defined(SIGLOST)
#include
#endif
#endif
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
#include
#if defined (BSD)
#if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
#else
#if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#endif
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname *un;
uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
case $UNAME_MACHINE:$UNAME_SYSTEM in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <&2 <&2 </dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = "$UNAME_MACHINE"
UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
fi
exit 1
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
feenox-1.1/depcomp 0000755 0001750 0001750 00000056020 14773607171 011155 0000000 0000000 #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# 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 2, 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 .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva .
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
feenox-1.1/README4academics 0000644 0001750 0001750 00000044776 14773607202 012410 0000000 0000000 FeenoX for Academics
- 1 What
- 2 How
- 3 Why
[1 What]: #what
[2 How]: #how
[3 Why]: #why
What
FeenoX is a cloud-first Unix stand-alone program (i.e. something your
run, not something you have to link existing code against) that reads an
engineering-related problem in a plain-text file containing definitions
and instructions. That is to say, it reads the problem to be solved at
run time and does not require the user (most of the time these will be
industry engineers and not hackers nor PhDs) to compile and link custom
code in order to solve a problem because it is not a library. It does
not require the users to write a weak form of the PDE they want to
solve, because most of them will not even know what a weak form is (and
they certainly do not need to know that). The user chooses from a set of
built-in PDEs using the PROBLEM definition which internally resolves (at
run time) a set of function pointers to the appropriate locations which
will build the elemental objects which correspond the to chosen PDE. The
list of available PDEs can be peeked by executing the feenox binary with
the --pdes option:
$ feenox --pdes
laplace
mechanical
modal
neutron_diffusion
neutron_sn
thermal
$
During the compilation procedure (based on Autotools), the source tree
in src/pdes is parsed. For each subdirectory, a new PDE is embedded into
the compiled binary. See below for further details about this
extensibility mechanism.
This program then solves the problem and, eventually, writes the outputs
which the input file requests with explicit instructions (and nothing if
nothing is asked for) and returns back to the Unix shell:
# NAFEMS Benchmark LE-10: thick plate pressure
PROBLEM mechanical DIMENSIONS 3
READ_MESH nafems-le10.msh # mesh in millimeters
# LOADING: uniform normal pressure on the upper surface
BC upper p=1 # 1 Mpa
# BOUNDARY CONDITIONS:
BC DCD'C' v=0 # Face DCD'C' zero y-displacement
BC ABA'B' u=0 # Face ABA'B' zero x-displacement
BC BCB'C' u=0 v=0 # Face BCB'C' x and y displ. fixed
BC midplane w=0 # z displacements fixed along mid-plane
# MATERIAL PROPERTIES: isotropic single-material properties
E = 210e3 # Young modulus in MPa
nu = 0.3 # Poisson's ratio
SOLVE_PROBLEM # solve!
# print the direct stress y at D (and nothing more)
PRINT "σ_y @ D = " sigmay(2000,0,300) "MPa"
It can be seen as a Unix filter (or as a transfer function)
+------------+
mesh (*.msh) } | | { terminal
data (*.dat) } input ----> | FeenoX |----> output { data files
input (*.fee) } | | { post (vtk/msh)
+------------+
which, when zoomed in, acts as a “glue layer” between a mesher (Gmsh)
and a library for solving large sparse problems (PETSc) which for linear
elastic looks as follows:
[]
Further discussion can be found in the tensile test tutorial. Check out
the section about invocation in the FeenoX manual.
The design responds to a Software Requirements Specification document
that acts as a “request for quotations” of a computational engineering
tool that should satisfy some fictitious (but plausible) requirements.
The Software Design Specification document explains how FeenoX addresses
each requirement of the SRS.
In principle, even though FeenoX can solve generic numerical problems
and systems of ordinary differential/algebraic equations, its main
objective is to solve partial differential equations using the finite
element method—eventually in parallel using the MPI standard. The
current version can solve
- Basic mathematics
- Systems of ODEs/DAEs
- Laplace’s equation
- Heat conduction
- Linear elasticity
- Modal analysis
- Neutron diffusion
- Neutron SN
Heads up! The background of FeenoX’s main author is Nuclear
Engineering. Hence,
- Two of the supported PDEs are related to neutron diffusion and
transport.
- There is a PhD thesis (in Spanish only) that discusses the design
and implementation of FeenoX in view of core-level neutronics.
As mentioned in the previous section, FeenoX provides a mechanism to add
new types of PDEs by adding a new subdirectory to the src/pdes directory
of the source tree and then re-bootstrapping, re-configuring and
re-compiling the code.
Since in FeenoX’s input file everything is an expression, the code is
especially suited for verification using the method of manufactured
solutions.
- See FeenoX for Engineers for links to further examples and
tutorials.
- See FeenoX for Hackers for more details about the implementation and
the code.
[FeenoX]: https://www.seamplex.com/feenox/
[cloud-first]: https://seamplex.com/feenox/doc/sds.html#cloud-first
[Unix]: ./README4hackers.md
[run]: https://www.seamplex.com/feenox/doc/feenox-manual.html#running-feenox
[engineering-related problem]: ./README4engineers.md
[plain-text file containing definitions and instructions]: https://seamplex.com/feenox/doc/sds.html#sec:input
[PROBLEM]: https://www.seamplex.com/feenox/doc/feenox-manual.html#problem
[src/pdes]: https://github.com/seamplex/feenox/tree/main/src/pdes
[extensibility mechanism]: https://www.seamplex.com/feenox/doc/sds.html#sec:extensibility
[explicit instructions]: https://www.seamplex.com/feenox/doc/sds.html#sec:output
[Gmsh]: http://gmsh.info/
[PETSc]: https://petsc.org/release/
[1]: doc/transfer-le10-zoom.svg
[tensile test tutorial]: https://www.seamplex.com/feenox/doc/tutorials/110-tensile-test/
[FeenoX manual]: https://www.seamplex.com/feenox/doc/feenox-manual.html
[Software Requirements Specification]: https://www.seamplex.com/feenox/doc/srs.html
[Software Design Specification]: https://www.seamplex.com/feenox/doc/sds.html
[generic numerical problems]: https://seamplex.com/feenox/examples/basic.html
[systems of ordinary differential/algebraic equations]: https://seamplex.com/feenox/examples/daes.html
[in parallel using the MPI standard]: https://seamplex.com/feenox/doc/sds.html#sec:scalability
[Laplace’s equation]: https://seamplex.com/feenox/examples/laplace.html
[Heat conduction]: https://seamplex.com/feenox/examples/thermal.html
[Linear elasticity]: https://seamplex.com/feenox/examples/mechanical.html
[Modal analysis]: https://seamplex.com/feenox/examples/modal.html
[Neutron diffusion]: https://seamplex.com/feenox/examples/neutron_diffusion.html
[Neutron SN]: https://seamplex.com/feenox/examples/neutron_sn.html
[diffusion]: https://www.seamplex.com/feenox/examples/neutron_diffusion.html
[transport]: https://www.seamplex.com/feenox/examples/neutron_sn.html
[PhD thesis (in Spanish only)]: https://seamplex.com/thesis/html/
[directory of the source tree and then re-bootstrapping, re-configuring and re-compiling the code]:
https://seamplex.com/feenox/doc/sds.html#sec:extensibility
[everything is an expression]: https://seamplex.com/feenox/doc/sds.html#sec:expression
[verification using the method of manufactured solutions]: https://github.com/seamplex/feenox/tree/main/tests/mms
How
FeenoX tries to achieve its goals by…
- standing on both ethical (since it is free) and technical (since it
is open source) ground while interacting with other free and open
specimens such as
- operating systems
- libraries
- compilers
- pre and post-processing tools thus encouraging science and
engineering to shift from privative environments into the free
world.
- leveraging the Unix programming philosophy to come up with a
cloud-first tool suitable to be automatically deployed and serve as
the back end of web-based interfaces (fig. ).
- providing a ready-to-run program that reads an input file at run
time (and not a library that has to be linked for each particular
problem to be solved) as deliberate decision discussed in the
Software Design Specification.
- designing and implementing an extensibility mechanism to allow
hackers and/or academics to add new PDE formulations by adding a new
subdirectory to src/pdes in the repository and then
a. re-bootstrapping with autogen.sh,
b. re-configuring with configure, and
c. re-compiling with make
In effect, FeenoX provides a general mathematical framework to solve
PDEs with a bunch of entry points (as C functions) where new types of
PDEs (e.g. electromagnetism, fluid mechanics, etc.) can be added to the
set of what FeenoX can solve. This general framework provides means to
- parse the input file, handle command-line arguments, read mesh
files, assign variables, evaluate conditionals, write results, etc.
PROBLEM laplace 2D
READ_MESH square-$1.msh
[...]
WRITE_RESULTS FORMAT vtk
- handle material properties given as algebraic expressions involving
pointwise-defined functions of space, temperature, time, etc.
MATERIAL steel E=210e3*(1-1e-3*(T(x,y,z)-20)) nu=0.3
MATERIAL aluminum E=69e3 nu=7/25
- read problem-specific boundary conditions as algebraic expressions
sigma = 5.670374419e-8 # W m^2 / K^4 as in wikipedia
e = 0.98 # non-dimensional
T0 = 1000 # K
Tinf = 300 # K
BC left T=T0
BC right q=sigma*e*(Tinf^4-T(x,y,z)^4)
- access shape functions and its derivatives evaluated either at Gauss
points or at arbitrary locations for computing elementary
contributions to
- stiffness matrix
- mass matrix
- right-hand side vector
For example, this snippet would build the elemental stiffness matrix
for the Laplace problem:
int build_laplace_Ki(element_t *e, unsigned int q) {
double wdet = feenox_fem_compute_w_det_at_gauss(e, q);
gsl_matrix *B = feenox_fem_compute_B_at_gauss(e, q);
feenox_call(feenox_blas_BtB_accum(B, wdet, feenox.fem.Ki));
return FEENOX_OK;
}
The calls for computing the weights and the matrices with the shape
functions and/or their derivatives currently support first and
second-order iso-geometric elements, but other element types can be
added as well.
More complex cases involving non-uniform material properties,
volumetric sources, etc. can be found in the actual source.
- solve the discretized equations using the appropriate PETSc/SLEPc
objects, i.e.
- KSP for linear static problems
- SNES for non-linear static problems
- TS for transient problems
- EPS for eigenvalue problems
The particular functions that implement each problem type are located in
subdirectories src/pdes, namely
- laplace
- thermal
- mechanical
- modal
- neutron_diffusion
- neutron_sn
Researchers with both knowledge of mathematical theory of finite
elements and programming skills might, with the aid of the community,
add support for other PDES. They might do that by using one of these
directories (say laplace) as a template and
1. replace every occurrence of laplace in symbol names with the name of
the new PDE
2. modify the initialization functions in init.c and set
- the names of the unknowns
- the names of the materials
- the mathematical type and properties of problem
- etc.
3. modify the contents of the elemental matrices in bulk.c in the FEM
formulation of the problem being added
4. modify the contents of how the boundary conditions are parsed and
set in bc.c
5. re-run autogen.sh, ./configure and make to get a FeenoX executable
with support for the new PDE.
As we mentioned in FeenoX for hackers, Alan Kay’s says: “simple things
should be simple and complex things should be possible.” Of course, the
addition of non-trivial PDEs is not straightforward, but possible (at
that time we were discussing the first half of the quote, now we refer
to the second part). The programming guide contains further details
about how to contribute to the code base.
- See FeenoX for engineers for more details about the problem types
FeenoX can solve and how to solve them.
- See FeenoX for hackers for more technical details about how FeenoX
works.
[both ethical (since it is free) and technical (since it is open source) ground]:
https://www.seamplex.com/feenox/doc/sds.html#sec:architecture
[Unix programming philosophy]: https://seamplex.com/feenox/doc/sds.html#sec:unix
[cloud-first tool]: https://seamplex.com/feenox/doc/sds.html#cloud-first
[automatically deployed]: https://seamplex.com/feenox/doc/sds.html#sec:deployment
[ready-to-run program]: https://seamplex.com/feenox/doc/sds.html#sec:execution
[an input file at run time]: https://seamplex.com/feenox/doc/sds.html#sec:input
[Software Design Specification]: https://www.seamplex.com/feenox/doc/sds.html
[2]:
[C functions]: https://www.seamplex.com/feenox/doc/programming.html#languages
[parse the input file]: https://seamplex.com/feenox/doc/sds.html#sec:nouns_verbs
[handle command-line arguments]: https://seamplex.com/feenox/doc/sds.html#sec:run-time-arguments
[read mesh files]: https://seamplex.com/feenox/doc/feenox-manual.html#read_mesh
[assign variables]: https://seamplex.com/feenox/doc/feenox-manual.html#description
[evaluate conditionals]: https://seamplex.com/feenox/doc/feenox-manual.html#if
[write results]: https://seamplex.com/feenox/doc/sds.html#sec:output
[material properties]: https://seamplex.com/feenox/doc/sds.html#sec:flexibility
[algebraic expressions]: https://seamplex.com/feenox/doc/sds.html#sec:expression
[space]: https://seamplex.com/feenox/doc/tutorials/320-thermal/#sec:mms
[temperature]: https://www.seamplex.com/feenox/examples/mechanical.html#temperature-dependent-material-properties
[time]: https://seamplex.com/feenox/doc/tutorials/320-thermal/#from-a-steady-state
[boundary conditions as algebraic expressions]: https://seamplex.com/feenox/doc/tutorials/320-thermal/#temperature-dependent-heat-flux-radiation
[stiffness matrix]: https://github.com/seamplex/feenox/blob/main/src/pdes/laplace/bulk.c#L33
[mass matrix]: https://github.com/seamplex/feenox/blob/main/src/pdes/modal/bulk.c#L98
[right-hand side vector]: https://github.com/seamplex/feenox/blob/main/src/pdes/thermal/bulk.c#L41
[Laplace problem]: https://github.com/seamplex/feenox/tree/main/src/pdes/laplace
[3]: https://petsc.org/
[SLEPc]: https://slepc.upv.es/
[KSP]: https://petsc.org/release/manual/ksp/
[linear static problems]: https://seamplex.com/feenox/doc/tutorials/320-thermal/#linear-steady-state-problems
[SNES]: https://petsc.org/release/manual/snes/
[non-linear static problems]: https://seamplex.com/feenox/doc/tutorials/320-thermal/#non-linear-state-state-problems
[TS]: https://petsc.org/release/manual/ts/
[transient problems]: https://seamplex.com/feenox/doc/tutorials/320-thermal/#sec:transient
[EPS]: https://slepc.upv.es/documentation/current/docs/manualpages/EPS/index.html
[eigenvalue problems]: https://seamplex.com/feenox/examples/neutron_diffusion.html#iaea-3d-pwr-benchmark
[src/pdes]: https://github.com/seamplex/feenox/tree/main/src/pdes
[thermal]: https://github.com/seamplex/feenox/tree/main/src/pdes/thermal
[mechanical]: https://github.com/seamplex/feenox/tree/main/src/pdes/mechanical
[modal]: https://github.com/seamplex/feenox/tree/main/src/pdes/modal
[neutron_diffusion]: https://github.com/seamplex/feenox/tree/main/src/pdes/neutron_difussion
[neutron_sn]: https://github.com/seamplex/feenox/tree/main/src/pdes/neutron_sn
[the community]: https://github.com/seamplex/feenox/discussions
[FeenoX for hackers]: ./README4hackers.md
[Alan Kay]: https://en.wikipedia.org/wiki/Alan_Kay
[“simple things should be simple and complex things should be possible.”]:
https://www.quora.com/What-is-the-story-behind-Alan-Kay-s-adage-Simple-things-should-be-simple-complex-things-should-be-possible
[programming guide]: doc/programming.md
[FeenoX for engineers]: ./README4engineers.md
Why
The world is already full of finite-element programs, and every day a
grad student creates a new one from scratch. So why adding FeenoX to the
already-crowded space of FEA tools? Because there are either
a. libraries which need code to use them such as
- Sparselizard
- MoFEM
- FEniCS
- MFEM
b. end-user programs which need a GUI such as
- CalculiX
- CodeAster
FeenoX sits in the middle. It is the only free and open-source tool that
satisfies the Software Requirements Specification, including that…
- in order to solve a problem one needs to prepare an input file (not
a script) which is read at run-time (not code which calls a library)
- these input files can expand generic command-line options using Bash
syntax as $1, $2, etc., which allow parametric or optimization loops
driven by higher-level scripts
- for solving PDEs, the input file has to refer to at least one Gmsh
.msh file that defines the domain where the PDE is solved
- the material properties and boundary conditions are defined using
physical groups and not individual nodes nor elements, so the input
file is independent of the mesh and thus can be tracked with Git to
increase traceability and repeatability.
- it uses the Unix philosophy which, among others, separates policy
from mechanism and thus FeenoX is a natural choice for web-based
interfaces like CAEplex.
See FeenoX for hackers for another explanation about why FeenoX is
different from other computational tools.
[Software Requirements Specification]: https://www.seamplex.com/feenox/doc/srs.html
[input file]: https://seamplex.com/feenox/doc/sds.html#sec:input
[read at run-time]: https://seamplex.com/feenox/doc/sds.html#sec:execution
[expand generic command-line options using Bash syntax as $1, $2, etc.]:
https://seamplex.com/feenox/doc/sds.html#sec:run-time-arguments
[parametric]: https://seamplex.com/feenox/doc/sds.html#sec:parametric
[optimization loops]: https://seamplex.com/feenox/doc/sds.html#sec:optimization
[one Gmsh .msh file]: https://seamplex.com/feenox/doc/sds.html#sec:interoperability
[material properties and boundary conditions]: https://seamplex.com/feenox/doc/sds.html#nafems-le10-benchmark
[tracked with Git]: https://seamplex.com/feenox/doc/sds.html#sec:git-friendliness
[traceability and repeatability]: https://seamplex.com/feenox/doc/sds.html#sec:traceability
[Unix philosophy]: https://seamplex.com/feenox/doc/sds.html#sec:unix
[separates policy from mechanism]: https://seamplex.com/feenox/doc/sds.html#sec:unix-separation
[CAEplex]: https://www.caeplex.com
[FeenoX for hackers]: ./README4hackers.md
feenox-1.1/missing 0000755 0001750 0001750 00000015336 14773607171 011204 0000000 0000000 #! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard , 1996.
# 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 2, 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 .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to ."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
feenox-1.1/aclocal.m4 0000644 0001750 0001750 00000122512 14773607170 011437 0000000 0000000 # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE([dependency-tracking], [dnl
AS_HELP_STRING(
[--enable-dependency-tracking],
[do not reject slow dependency extractors])
AS_HELP_STRING(
[--disable-dependency-tracking],
[speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
AS_CASE([$CONFIG_FILES],
[*\'*], [eval set x "$CONFIG_FILES"],
[*], [set x $CONFIG_FILES])
shift
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`AS_DIRNAME(["$am_mf"])`
am_filepart=`AS_BASENAME(["$am_mf"])`
AM_RUN_LOG([cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles]) || am_rc=$?
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
AS_UNSET([am_dirpart])
AS_UNSET([am_filepart])
AS_UNSET([am_mf])
AS_UNSET([am_rc])
rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking is enabled.
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])
[_AM_PROG_CC_C_O
])
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
m4_ifdef([_$0_ALREADY_INIT],
[m4_fatal([$0 expanded multiple times
]m4_defn([_$0_ALREADY_INIT]))],
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated.])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
#
#
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
[m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES([CXX])],
[m4_define([AC_PROG_CXX],
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
# Variables for tags utilities; see am/tags.am
if test -z "$CTAGS"; then
CTAGS=ctags
fi
AC_SUBST([CTAGS])
if test -z "$ETAGS"; then
ETAGS=etags
fi
AC_SUBST([ETAGS])
if test -z "$CSCOPE"; then
CSCOPE=cscope
fi
AC_SUBST([CSCOPE])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard:
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: .
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAKE_INCLUDE()
# -----------------
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
am__include="#"
am__quote=
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
['0:this is the am__doit target'],
[AS_CASE([$s],
[BSD], [am__include='.include' am__quote='"'],
[am__include='include' am__quote=''])])
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
AC_MSG_RESULT([${_am_result}])
AC_SUBST([am__include])])
AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it is modern enough.
# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
fi
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_CC_C_O
# ---------------
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
# to automatically call this.
AC_DEFUN([_AM_PROG_CC_C_O],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
AC_LANG_PUSH([C])dnl
AC_CACHE_CHECK(
[whether $CC understands -c and -o together],
[am_cv_prog_cc_c_o],
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
# Make sure it works both with $CC and with simple cc.
# Following AC_PROG_CC_C_O, we do the test twice because some
# compilers refuse to overwrite an existing .o file with -o,
# though they will create one.
am_cv_prog_cc_c_o=yes
for am_i in 1 2; do
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
&& test -f conftest2.$ac_objext; then
: OK
else
am_cv_prog_cc_c_o=no
break
fi
done
rm -f core conftest*
unset am_i])
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
AC_DEFUN([AM_RUN_LOG],
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
AC_MSG_RESULT([done])])
rm -f conftest.file
])
# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
AC_CACHE_CHECK([whether $am_make supports nested variables],
[am_cv_make_support_nested_variables],
[if AS_ECHO([['TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1],
[ustar],
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi],
[pax],
[],
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
feenox-1.1/doc/ 0000755 0001750 0001750 00000000000 14773607277 010431 5 0000000 0000000 feenox-1.1/doc/CODE_OF_CONDUCT 0000644 0001750 0001750 00000015010 14773607243 012537 0000000 0000000 FeenoX Code of Conduct
Jeremy Theler
2025-04-03
- 1 Our Pledge
- 2 Our Standards
- 3 Enforcement Responsibilities
- 4 Scope
- 5 Enforcement
- 6 Enforcement Guidelines
- 6.1 1. Correction
- 6.2 2. Warning
- 6.3 3. Temporary Ban
- 6.4 4. Permanent Ban
- 7 Attribution
- Be kind to others. Do not insult or put down others. Behave
professionally. Remember that harassment and sexist, racist, or
exclusionary jokes are not appropriate for FeenoX.
- All communication should be appropriate for a professional audience
including people of many different backgrounds. Sexual language and
imagery is not appropriate.
- FeenoX is dedicated to providing a harassment-free community for
everyone, regardless of gender, sexual orientation, gender identity
and expression, disability, physical appearance, body size, race, or
religion. We do not tolerate harassment of community members in any
form.
- Help to make this a welcoming, friendly community for all.
[1 Our Pledge]: #our-pledge
[2 Our Standards]: #our-standards
[3 Enforcement Responsibilities]: #enforcement-responsibilities
[4 Scope]: #scope
[5 Enforcement]: #enforcement
[6 Enforcement Guidelines]: #enforcement-guidelines
[6.1 1. Correction]: #correction
[6.2 2. Warning]: #warning
[6.3 3. Temporary Ban]: #temporary-ban
[6.4 4. Permanent Ban]: #permanent-ban
[7 Attribution]: #attribution
Our Pledge
We as members, contributors, and leaders pledge to make participation in
our community a harassment-free experience for everyone, regardless of
age, body size, visible or invisible disability, ethnicity, sex
characteristics, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance,
race, caste, color, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open,
welcoming, diverse, inclusive, and healthy community.
Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our
mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for
thea overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or
political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in
a professional setting
Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our
standards of acceptable behavior and will take appropriate and fair
corrective action in response to any behavior that they deem
inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct, and will
communicate reasons for moderation decisions when appropriate.
Scope
This Code of Conduct applies within all community spaces, and also
applies when an individual is officially representing the community in
public spaces. Examples of representing our community include using an
official e-mail address, posting via an official social media account,
or acting as an appointed representative at an online or offline event.
Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may
be reported to the community leaders responsible for enforcement at
jeremy@seamplex.com. All complaints will be reviewed and investigated
promptly and fairly.
All community leaders are obligated to respect the privacy and security
of the reporter of any incident.
Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in
determining the consequences for any action they deem in violation of
this Code of Conduct:
1. Correction
Community Impact: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
Consequence: A private, written warning from community leaders,
providing clarity around the nature of the violation and an explanation
of why the behavior was inappropriate. A public apology may be
requested.
2. Warning
Community Impact: A violation through a single incident or series of
actions.
Consequence: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, for a specified period of
time. This includes avoiding interactions in community spaces as well as
external channels like social media. Violating these terms may lead to a
temporary or permanent ban.
3. Temporary Ban
Community Impact: A serious violation of community standards, including
sustained inappropriate behavior.
Consequence: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No
public or private interaction with the people involved, including
unsolicited interaction with those enforcing the Code of Conduct, is
allowed during this period. Violating these terms may lead to a
permanent ban.
4. Permanent Ban
Community Impact: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of
individuals.
Consequence: A permanent ban from any sort of public interaction within
the community.
Attribution
This Code of Conduct is adapted from the Contributor Covenant, version
2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by Mozilla’s code of conduct
enforcement ladder.
For answers to common questions about this code of conduct, see the FAQ
at https://www.contributor-covenant.org/faq. Translations are available
at https://www.contributor-covenant.org/translations.
[Contributor Covenant]: https://www.contributor-covenant.org
[Mozilla’s code of conduct enforcement ladder]: https://github.com/mozilla/diversity
feenox-1.1/doc/feenox-manual 0000644 0001750 0001750 00000601012 14773607261 013024 0000000 0000000 FeenoX manual
Jeremy Theler
2025-04-03
- 1 Overview
- 2 Introduction
- 3 Running feenox
- 3.1 Invocation
- 3.2 Compilation
- 3.2.1 Quickstart
- 3.2.2 Detailed configuration and compilation
- 3.2.2.1 Mandatory dependencies
- 3.2.2.2 Optional dependencies
- 3.2.2.3 FeenoX source code
- 3.2.2.4 Configuration
- 3.2.2.5 Source code compilation
- 3.2.2.6 Test suite
- 3.2.2.7 Installation
- 3.2.3 Advanced settings
- 3.2.3.1 Compiling with debug symbols
- 3.2.3.2 Using a different compiler
- 3.2.3.3 Compiling PETSc
- 4 Examples
- 5 Tutorials
- 5.1 General tutorials
- 5.2 Detailed functionality
- 5.3 Physics tutorials
- 6 Description
- 6.1 Algebraic expressions
- 6.2 Initial conditions
- 6.3 Expansions of command line arguments
- 7 Reference
- 7.1 Differential-Algebraic Equations subsystem
- 7.1.1 DAE keywords
- 7.1.1.1 INITIAL_CONDITIONS
- 7.1.1.2 PHASE_SPACE
- 7.1.1.3 TIME_PATH
- 7.1.2 DAE variables
- 7.1.2.1 dae_rtol
- 7.2 Partial Differential Equations subsystem
- 7.2.1 PDE keywords
- 7.2.1.1 BC
- 7.2.1.2 COMPUTE_REACTION
- 7.2.1.3 DUMP
- 7.2.1.4 FIND_EXTREMA
- 7.2.1.5 INTEGRATE
- 7.2.1.6 MATERIAL
- 7.2.1.7 PETSC_OPTIONS
- 7.2.1.8 PHYSICAL_GROUP
- 7.2.1.9 PROBLEM
- 7.2.1.10 READ_MESH
- 7.2.1.11 SOLVE_PROBLEM
- 7.2.1.12 WRITE_MESH
- 7.2.1.13 WRITE_RESULTS
- 7.2.2 PDE variables
- 7.3 Laplace’s equation
- 7.3.1 Laplace results
- 7.3.1.1 phi
- 7.3.2 Laplace properties
- 7.3.2.1 alpha
- 7.3.2.2 f
- 7.3.3 Laplace boundary conditions
- 7.3.3.1 dphidn
- 7.3.3.2 phi
- 7.3.3.3 phi'
- 7.3.4 Laplace keywords
- 7.3.5 Laplace variables
- 7.4 The heat conduction equation
- 7.4.1 Thermal results
- 7.4.1.1 qx
- 7.4.1.2 qy
- 7.4.1.3 qz
- 7.4.1.4 T
- 7.4.2 Thermal properties
- 7.4.2.1 cp
- 7.4.2.2 k
- 7.4.2.3 kappa
- 7.4.2.4 q
- 7.4.2.5 q'''
- 7.4.2.6 rho
- 7.4.2.7 rhocp
- 7.4.2.8 T_0
- 7.4.2.9 T_guess
- 7.4.3 Thermal boundary conditions
- 7.4.4 Thermal keywords
- 7.4.5 Thermal variables
- 7.4.5.1 T_max
- 7.4.5.2 T_min
- 7.5 Linear elasticity
- 7.5.1 Elasticity results
- 7.5.2 Elasticity properties
- 7.5.3 Elasticity boundary conditions
- 7.5.4 Elasticity keywords
- 7.5.4.1 LINEARIZE_STRESS
- 7.5.5 Elasticity variables
- 7.6 Neutron transport with discrete ordinates
- 7.6.1 Neutron transport results
- 7.6.2 Neutron transport properties
- 7.6.3 Neutron transport boundary conditions
- 7.6.4 Neutron transport keywords
- 7.6.5 Neutron transport variables
- 7.6.5.1 chi
- 7.6.5.2 keff
- 7.6.5.3 sn_alpha
- 7.7 General & “standalone” mathematics
- 7.7.1 Keywords
- 7.7.1.1 ABORT
- 7.7.1.2 ALIAS
- 7.7.1.3 CLOSE
- 7.7.1.4 DEFAULT_ARGUMENT_VALUE
- 7.7.1.5 FILE
- 7.7.1.6 FIT
- 7.7.1.7 FUNCTION
- 7.7.1.8 IF
- 7.7.1.9 IMPLICIT
- 7.7.1.10 INCLUDE
- 7.7.1.11 MATRIX
- 7.7.1.12 OPEN
- 7.7.1.13 PRINT
- 7.7.1.14 PRINTF
- 7.7.1.15 PRINT_FUNCTION
- 7.7.1.16 PRINT_VECTOR
- 7.7.1.17 SOLVE
- 7.7.1.18 SORT_VECTOR
- 7.7.1.19 VAR
- 7.7.1.20 VECTOR
- 7.7.2 Variables
- 7.7.2.1 done
- 7.7.2.2 done_static
- 7.7.2.3 done_transient
- 7.7.2.4 dt
- 7.7.2.5 end_time
- 7.7.2.6 i
- 7.7.2.7 infinite
- 7.7.2.8 in_static
- 7.7.2.9 in_static_first
- 7.7.2.10 in_static_last
- 7.7.2.11 in_time_path
- 7.7.2.12 in_transient
- 7.7.2.13 in_transient_first
- 7.7.2.14 in_transient_last
- 7.7.2.15 j
- 7.7.2.16 max_dt
- 7.7.2.17 min_dt
- 7.7.2.18 mpi_rank
- 7.7.2.19 mpi_size
- 7.7.2.20 on_gsl_error
- 7.7.2.21 on_ida_error
- 7.7.2.22 on_nan
- 7.7.2.23 pi
- 7.7.2.24 pid
- 7.7.2.25 static_steps
- 7.7.2.26 step_static
- 7.7.2.27 step_transient
- 7.7.2.28 t
- 7.7.2.29 zero
- 7.8 Functions
- 7.8.1 abs
- 7.8.2 acos
- 7.8.3 asin
- 7.8.4 atan
- 7.8.5 atan2
- 7.8.6 ceil
- 7.8.7 clock
- 7.8.8 cos
- 7.8.9 cosh
- 7.8.10 cpu_time
- 7.8.11 d_dt
- 7.8.12 deadband
- 7.8.13 equal
- 7.8.14 exp
- 7.8.15 expint1
- 7.8.16 expint2
- 7.8.17 expint3
- 7.8.18 expintn
- 7.8.19 floor
- 7.8.20 gammaf
- 7.8.21 heaviside
- 7.8.22 if
- 7.8.23 integral_dt
- 7.8.24 integral_euler_dt
- 7.8.25 is_even
- 7.8.26 is_in_interval
- 7.8.27 is_odd
- 7.8.28 j0
- 7.8.29 lag
- 7.8.30 lag_bilinear
- 7.8.31 lag_euler
- 7.8.32 last
- 7.8.33 limit
- 7.8.34 limit_dt
- 7.8.35 log
- 7.8.36 mark_max
- 7.8.37 mark_min
- 7.8.38 max
- 7.8.39 memory
- 7.8.40 min
- 7.8.41 mod
- 7.8.42 mpi_memory_local
- 7.8.43 not
- 7.8.44 random
- 7.8.45 random_gauss
- 7.8.46 round
- 7.8.47 sawtooth_wave
- 7.8.48 sech
- 7.8.49 sgn
- 7.8.50 sin
- 7.8.51 sinh
- 7.8.52 sqrt
- 7.8.53 square_wave
- 7.8.54 tan
- 7.8.55 tanh
- 7.8.56 threshold_max
- 7.8.57 threshold_min
- 7.8.58 triangular_wave
- 7.8.59 wall_time
- 7.9 Functionals
- 7.9.1 derivative
- 7.9.2 func_min
- 7.9.3 gauss_kronrod
- 7.9.4 gauss_legendre
- 7.9.5 integral
- 7.9.6 prod
- 7.9.7 root
- 7.9.8 sum
- 7.10 Vector functions
- 7.10.1 vecdot
- 7.10.2 vecmax
- 7.10.3 vecmaxindex
- 7.10.4 vecmin
- 7.10.5 vecminindex
- 7.10.6 vecnorm
- 7.10.7 vecsize
- 7.10.8 vecsum
- 8 FeenoX & the Unix Philospohy
- 8.1 Rule of Modularity
- 8.2 Rule of Clarity
- 8.3 Rule of Composition
- 8.4 Rule of Separation
- 8.5 Rule of Simplicity
- 8.6 Rule of Parsimony
- 8.7 Rule of Transparency
- 8.8 Rule of Robustness
- 8.9 Rule of Representation
- 8.10 Rule of Least Surprise
- 8.11 Rule of Silence
- 8.12 Rule of Repair
- 8.13 Rule of Economy
- 8.14 Rule of Generation
- 8.15 Rule of Optimization
- 8.16 Rule of Diversity
- 8.17 Rule of Extensibility
- 9 History
[1 Overview]: #overview
[2 Introduction]: #introduction
[3 Running feenox]: #running-feenox
[3.1 Invocation]: #invocation
[3.2 Compilation]: #compilation
[3.2.1 Quickstart]: #quickstart
[3.2.2 Detailed configuration and compilation]: #sec:details
[3.2.2.1 Mandatory dependencies]: #mandatory-dependencies
[3.2.2.2 Optional dependencies]: #optional-dependencies
[3.2.2.3 FeenoX source code]: #feenox-source-code
[3.2.2.4 Configuration]: #configuration
[3.2.2.5 Source code compilation]: #sec:compilation
[3.2.2.6 Test suite]: #sec:test-suite
[3.2.2.7 Installation]: #installation
[3.2.3 Advanced settings]: #advanced-settings
[3.2.3.1 Compiling with debug symbols]: #compiling-with-debug-symbols
[3.2.3.2 Using a different compiler]: #using-a-different-compiler
[3.2.3.3 Compiling PETSc]: #compiling-petsc
[4 Examples]: #examples
[5 Tutorials]: #tutorials
[5.1 General tutorials]: #general-tutorials
[5.2 Detailed functionality]: #detailed-functionality
[5.3 Physics tutorials]: #physics-tutorials
[6 Description]: #description
[6.1 Algebraic expressions]: #algebraic-expressions
[6.2 Initial conditions]: #initial-conditions
[6.3 Expansions of command line arguments]: #expansions-of-command-line-arguments
[7 Reference]: #reference
[7.1 Differential-Algebraic Equations subsystem]: #differential-algebraic-equations-subsystem
[7.1.1 DAE keywords]: #dae-keywords
[7.1.1.1 INITIAL_CONDITIONS]: #initial_conditions
[7.1.1.2 PHASE_SPACE]: #phase_space
[7.1.1.3 TIME_PATH]: #time_path
[7.1.2 DAE variables]: #dae-variables
[7.1.2.1 dae_rtol]: #dae_rtol
[7.2 Partial Differential Equations subsystem]: #partial-differential-equations-subsystem
[7.2.1 PDE keywords]: #pde-keywords
[7.2.1.1 BC]: #bc
[7.2.1.2 COMPUTE_REACTION]: #compute_reaction
[7.2.1.3 DUMP]: #dump
[7.2.1.4 FIND_EXTREMA]: #find_extrema
[7.2.1.5 INTEGRATE]: #integrate
[7.2.1.6 MATERIAL]: #material
[7.2.1.7 PETSC_OPTIONS]: #petsc_options
[7.2.1.8 PHYSICAL_GROUP]: #physical_group
[7.2.1.9 PROBLEM]: #problem
[7.2.1.10 READ_MESH]: #read_mesh
[7.2.1.11 SOLVE_PROBLEM]: #solve_problem
[7.2.1.12 WRITE_MESH]: #write_mesh
[7.2.1.13 WRITE_RESULTS]: #write_results
[7.2.2 PDE variables]: #pde-variables
[7.3 Laplace’s equation]: #laplaces-equation
[7.3.1 Laplace results]: #laplace-results
[7.3.1.1 phi]: #phi
[7.3.2 Laplace properties]: #laplace-properties
[7.3.2.1 alpha]: #alpha
[7.3.2.2 f]: #f
[7.3.3 Laplace boundary conditions]: #laplace-boundary-conditions
[7.3.3.1 dphidn]: #dphidn
[7.3.3.3 phi']: #phi-1
[7.3.4 Laplace keywords]: #laplace-keywords
[7.3.5 Laplace variables]: #laplace-variables
[7.4 The heat conduction equation]: #thermal
[7.4.1 Thermal results]: #thermal-results
[7.4.1.1 qx]: #qx
[7.4.1.2 qy]: #qy
[7.4.1.3 qz]: #qz
[7.4.1.4 T]: #t
[7.4.2 Thermal properties]: #thermal-properties
[7.4.2.1 cp]: #cp
[7.4.2.2 k]: #k
[7.4.2.3 kappa]: #kappa
[7.4.2.4 q]: #q
[7.4.2.5 q''']: #q-1
[7.4.2.6 rho]: #rho
[7.4.2.7 rhocp]: #rhocp
[7.4.2.8 T_0]: #t_0
[7.4.2.9 T_guess]: #t_guess
[7.4.3 Thermal boundary conditions]: #thermal-boundary-conditions
[7.4.4 Thermal keywords]: #thermal-keywords
[7.4.5 Thermal variables]: #thermal-variables
[7.4.5.1 T_max]: #t_max
[7.4.5.2 T_min]: #t_min
[7.5 Linear elasticity]: #mechanical
[7.5.1 Elasticity results]: #elasticity-results
[7.5.2 Elasticity properties]: #elasticity-properties
[7.5.3 Elasticity boundary conditions]: #elasticity-boundary-conditions
[7.5.4 Elasticity keywords]: #elasticity-keywords
[7.5.4.1 LINEARIZE_STRESS]: #linearize_stress
[7.5.5 Elasticity variables]: #elasticity-variables
[7.6 Neutron transport with discrete ordinates]: #neutron-transport-with-discrete-ordinates
[7.6.1 Neutron transport results]: #neutron-transport-results
[7.6.2 Neutron transport properties]: #neutron-transport-properties
[7.6.3 Neutron transport boundary conditions]: #neutron-transport-boundary-conditions
[7.6.4 Neutron transport keywords]: #neutron-transport-keywords
[7.6.5 Neutron transport variables]: #neutron-transport-variables
[7.6.5.1 chi]: #chi
[7.6.5.2 keff]: #keff
[7.6.5.3 sn_alpha]: #sn_alpha
[7.7 General & “standalone” mathematics]: #general-standalone-mathematics
[7.7.1 Keywords]: #keywords
[7.7.1.1 ABORT]: #abort
[7.7.1.2 ALIAS]: #alias
[7.7.1.3 CLOSE]: #close
[7.7.1.4 DEFAULT_ARGUMENT_VALUE]: #default_argument_value
[7.7.1.5 FILE]: #file
[7.7.1.6 FIT]: #fit
[7.7.1.7 FUNCTION]: #function
[7.7.1.8 IF]: #if
[7.7.1.9 IMPLICIT]: #implicit
[7.7.1.10 INCLUDE]: #include
[7.7.1.11 MATRIX]: #matrix
[7.7.1.12 OPEN]: #open
[7.7.1.13 PRINT]: #print
[7.7.1.14 PRINTF]: #printf
[7.7.1.15 PRINT_FUNCTION]: #print_function
[7.7.1.16 PRINT_VECTOR]: #print_vector
[7.7.1.17 SOLVE]: #solve
[7.7.1.18 SORT_VECTOR]: #sort_vector
[7.7.1.19 VAR]: #var
[7.7.1.20 VECTOR]: #vector
[7.7.2 Variables]: #variables
[7.7.2.1 done]: #done
[7.7.2.2 done_static]: #done_static
[7.7.2.3 done_transient]: #done_transient
[7.7.2.4 dt]: #dt
[7.7.2.5 end_time]: #end_time
[7.7.2.6 i]: #i
[7.7.2.7 infinite]: #infinite
[7.7.2.8 in_static]: #in_static
[7.7.2.9 in_static_first]: #in_static_first
[7.7.2.10 in_static_last]: #in_static_last
[7.7.2.11 in_time_path]: #in_time_path
[7.7.2.12 in_transient]: #in_transient
[7.7.2.13 in_transient_first]: #in_transient_first
[7.7.2.14 in_transient_last]: #in_transient_last
[7.7.2.15 j]: #j
[7.7.2.16 max_dt]: #max_dt
[7.7.2.17 min_dt]: #min_dt
[7.7.2.18 mpi_rank]: #mpi_rank
[7.7.2.19 mpi_size]: #mpi_size
[7.7.2.20 on_gsl_error]: #on_gsl_error
[7.7.2.21 on_ida_error]: #on_ida_error
[7.7.2.22 on_nan]: #on_nan
[7.7.2.23 pi]: #pi
[7.7.2.24 pid]: #pid
[7.7.2.25 static_steps]: #static_steps
[7.7.2.26 step_static]: #step_static
[7.7.2.27 step_transient]: #step_transient
[7.7.2.29 zero]: #zero
[7.8 Functions]: #functions
[7.8.1 abs]: #abs
[7.8.2 acos]: #acos
[7.8.3 asin]: #asin
[7.8.4 atan]: #atan
[7.8.5 atan2]: #atan2
[7.8.6 ceil]: #ceil
[7.8.7 clock]: #clock
[7.8.8 cos]: #cos
[7.8.9 cosh]: #cosh
[7.8.10 cpu_time]: #cpu_time
[7.8.11 d_dt]: #d_dt
[7.8.12 deadband]: #deadband
[7.8.13 equal]: #equal
[7.8.14 exp]: #exp
[7.8.15 expint1]: #expint1
[7.8.16 expint2]: #expint2
[7.8.17 expint3]: #expint3
[7.8.18 expintn]: #expintn
[7.8.19 floor]: #floor
[7.8.20 gammaf]: #gammaf
[7.8.21 heaviside]: #heaviside
[7.8.23 integral_dt]: #integral_dt
[7.8.24 integral_euler_dt]: #integral_euler_dt
[7.8.25 is_even]: #is_even
[7.8.26 is_in_interval]: #is_in_interval
[7.8.27 is_odd]: #is_odd
[7.8.28 j0]: #j0
[7.8.29 lag]: #lag
[7.8.30 lag_bilinear]: #lag_bilinear
[7.8.31 lag_euler]: #lag_euler
[7.8.32 last]: #last
[7.8.33 limit]: #limit
[7.8.34 limit_dt]: #limit_dt
[7.8.35 log]: #log
[7.8.36 mark_max]: #mark_max
[7.8.37 mark_min]: #mark_min
[7.8.38 max]: #max
[7.8.39 memory]: #memory
[7.8.40 min]: #min
[7.8.41 mod]: #mod
[7.8.42 mpi_memory_local]: #mpi_memory_local
[7.8.43 not]: #not
[7.8.44 random]: #random
[7.8.45 random_gauss]: #random_gauss
[7.8.46 round]: #round
[7.8.47 sawtooth_wave]: #sawtooth_wave
[7.8.48 sech]: #sech
[7.8.49 sgn]: #sgn
[7.8.50 sin]: #sin
[7.8.51 sinh]: #sinh
[7.8.52 sqrt]: #sqrt
[7.8.53 square_wave]: #square_wave
[7.8.54 tan]: #tan
[7.8.55 tanh]: #tanh
[7.8.56 threshold_max]: #threshold_max
[7.8.57 threshold_min]: #threshold_min
[7.8.58 triangular_wave]: #triangular_wave
[7.8.59 wall_time]: #wall_time
[7.9 Functionals]: #functionals
[7.9.1 derivative]: #derivative
[7.9.2 func_min]: #func_min
[7.9.3 gauss_kronrod]: #gauss_kronrod
[7.9.4 gauss_legendre]: #gauss_legendre
[7.9.5 integral]: #integral
[7.9.6 prod]: #prod
[7.9.7 root]: #root
[7.9.8 sum]: #sum
[7.10 Vector functions]: #vector-functions
[7.10.1 vecdot]: #vecdot
[7.10.2 vecmax]: #vecmax
[7.10.3 vecmaxindex]: #vecmaxindex
[7.10.4 vecmin]: #vecmin
[7.10.5 vecminindex]: #vecminindex
[7.10.6 vecnorm]: #vecnorm
[7.10.7 vecsize]: #vecsize
[7.10.8 vecsum]: #vecsum
[8 FeenoX & the Unix Philospohy]: #feenox-the-unix-philospohy
[8.1 Rule of Modularity]: #sec:unix-modularity
[8.2 Rule of Clarity]: #sec:unix-clarity
[8.3 Rule of Composition]: #sec:unix-composition
[8.4 Rule of Separation]: #sec:unix-separation
[8.5 Rule of Simplicity]: #sec:unix-simplicity
[8.6 Rule of Parsimony]: #sec:unix-parsimony
[8.7 Rule of Transparency]: #sec:unix-transparency
[8.8 Rule of Robustness]: #sec:unix-robustness
[8.9 Rule of Representation]: #sec:unix-representation
[8.10 Rule of Least Surprise]: #sec:unix-least-surprise
[8.11 Rule of Silence]: #sec:unix-silence
[8.12 Rule of Repair]: #sec:unix-repair
[8.13 Rule of Economy]: #sec:unix-economy
[8.14 Rule of Generation]: #sec:unix-generation
[8.15 Rule of Optimization]: #sec:unix-optimization
[8.16 Rule of Diversity]: #sec:unix-diversity
[8.17 Rule of Extensibility]: #sec:unix-extensibility
[9 History]: #history
Overview
FeenoX is a computational tool that can solve engineering problems which
are usually casted as differential-algebraic equations (DAEs) or partial
differential equations (PDEs). It is to finite elements programs and
libraries what Markdown is to Word and TeX, respectively. In particular,
it can solve
- dynamical systems defined by a set of user-provided DAEs (such as
plant control dynamics for example)
- mechanical elasticity
- heat conduction
- structural modal analysis
- neutron diffusion
- neutron transport
FeenoX reads a plain-text input file which contains the problem
definition and writes 100%-user defined results in ASCII (through PRINT
or other user-defined output instructions within the input file). For
PDE problems, it needs a reference to at least one Gmsh mesh file for
the discretization of the domain. It can write post-processing views in
either .msh, .vtu or .vtk formats.
Keep in mind that FeenoX is just a back end reading a set of input files
and writing a set of output files following the design philosophy of
Unix (separation, composition, representation, economy, extensibility,
etc). Think of it as a transfer function (or a filter in
computer-science jargon) between input files and output files:
+------------+
mesh (*.msh) } | | { terminal
data (*.dat) } input ----> | FeenoX |----> output { data files
input (*.fee) } | | { post (vtk/msh)
+------------+
Following the Unix programming philosophy, there are no graphical
interfaces attached to the FeenoX core, although a wide variety of pre
and post-processors can be used with FeenoX. To illustrate the
transfer-function approach, consider the following input file that
solves Laplace’s equation ∇²ϕ = 0 on a square with some space-dependent
boundary conditions:
$$
\begin{cases}
\phi(x,y) = +y & \text{for $x=-1$ (left)} \\
\phi(x,y) = -y & \text{for $x=+1$ (right)} \\
\nabla \phi \cdot \hat{\vec{n}} = \sin\left(\frac{\pi}{2} \cdot x\right) & \text{for $y=-1$ (bottom)} \\
\nabla \phi \cdot \hat{\vec{n}} =0 & \text{for $y=+1$ (top)} \\
\end{cases}
$$
PROBLEM laplace 2d
READ_MESH square-centered.msh # [-1:+1]x[-1:+1]
# boundary conditions
BC left phi=+y
BC right phi=-y
BC bottom dphidn=sin(pi/2*x)
BC top dphidn=0
SOLVE_PROBLEM
# same output in .msh and in .vtk formats
WRITE_MESH laplace-square.msh phi VECTOR dphidx dphidy 0
WRITE_MESH laplace-square.vtk phi VECTOR dphidx dphidy 0
[a] [b]
Figure 1: Laplace’s equation solved with FeenoX. a — Post-processed with
Gmsh, b — Post-processed with Paraview
The .msh file can be post-processed with Gmsh, and the .vtu/.vtk file
can be post-processed with Paraview. See https://www.caeplex.com for a
mobile-friendly web-based interface for solving finite elements in the
cloud directly from the browser.
[Gmsh]: http://gmsh.info/
[a]: laplace-square-gmsh
[b]: laplace-square-paraview
[Paraview]: https://www.paraview.org/
Introduction
FeenoX can be seen either as
- a syntactically-sweetened way of asking the computer to solve
engineering-related mathematical problems, and/or
- a finite-element(ish) tool with a particular design basis.
Note that some of the problems solved with FeenoX might not actually
rely on the finite element method, but on general mathematical models
and even on the finite volumes method. That is why we say it is a
finite-element(ish) tool.
In other words, FeenoX is a computational tool to solve
- dynamical systems written as sets of ODEs/DAEs, or
- steady or transient heat conduction problems, or
- steady or quasi-static thermo-mechanical problems, or
- modal analysis problems, or
- core-level steady-state neutronics, or
- community-contributed problems
in such a way that the input is a near-English text file that defines
the problem to be solved.
One of the main features of this allegedly particular design basis is
that simple problems ought to have simple inputs (rule of simplicity)
or, quoting Alan Kay, “simple things should be simple, complex things
should be possible.”
For instance, to solve one-dimensional heat conduction over the domain
x ∈ [0, 1] (which is indeed one of the most simple engineering problems
we can find) the following input file is enough:
PROBLEM thermal 1D # tell FeenoX what we want to solve
READ_MESH slab.msh # read mesh in Gmsh's v4.1 format
k = 1 # set uniform conductivity
BC left T=0 # set fixed temperatures as BCs
BC right T=1 # "left" and "right" are defined in the mesh
SOLVE_PROBLEM # tell FeenoX we are ready to solve the problem
PRINT T(0.5) # ask for the temperature at x=0.5
$ feenox thermal-1d-dirichlet-constant-k.fee
0.5
$
The mesh is assumed to have been already created with Gmsh (or any other
pre-processing tool and converted to .msh format with Meshio for
example). This assumption follows the rule of composition and prevents
the actual input file from being polluted with mesh-dependent data (such
as node coordinates and/or nodal loads) so as to keep it simple and make
it Git-friendly (rule of generation). The only link between the mesh and
the FeenoX input file is through physical groups (in the case above left
and right) used to set boundary conditions and/or material properties.
Another design-basis decision is that similar problems ought to have
similar inputs (rule of least surprise). So in order to have a
space-dependent conductivity, we only have to replace one line in the
input above: instead of defining a scalar k we define a function of x
(we also update the output to show the analytical solution as well):
PROBLEM thermal 1D
READ_MESH slab.msh
k(x) = 1+x # space-dependent conductivity
BC left T=0
BC right T=1
SOLVE_PROBLEM
PRINT T(1/2) log(1+1/2)/log(2) # print numerical and analytical solutions
$ feenox thermal-1d-dirichlet-space-k.fee
0.584959 0.584963
$
The other main decision in FeenoX design is an everything is an
expression design principle, meaning that any numerical input can be an
algebraic expression (e.g. T(1/2) is the same as T(0.5)). If we want to
have a temperature-dependent conductivity (which renders the problem
non-linear) we can take advantage of the fact that T(x) is available not
only as an argument to PRINT but also for the definition of algebraic
functions:
PROBLEM thermal 1D
READ_MESH slab.msh
k(x) = 1+T(x) # temperature-dependent conductivity
BC left T=0
BC right T=1
SOLVE_PROBLEM
PRINT T(1/2) sqrt(1+(3*0.5))-1 # print numerical and analytical solutions
$ feenox thermal-1d-dirichlet-temperature-k.fee
0.581139 0.581139
$
Let us consider the famous chaotic Lorenz’s dynamical system. Here is
one way of getting an image of the butterfly-shaped attractor using
FeenoX to compute it and Gnuplot to draw it. Solve
ẋ = σ ⋅ (y − x)
ẏ = x ⋅ (r − z) − y
ż = xy − bz
for 0 < t < 40 with initial conditions
x(0) = −11
y(0) = −16
z(0) = 22.5
and σ = 10, r = 28 and b = 8/3, which are the classical parameters that
generate the butterfly as presented by Edward Lorenz back in his seminal
1963 paper Deterministic non-periodic flow.
The following ASCII input file resembles the parameters, initial
conditions and differential equations of the problem as naturally as
possible:
PHASE_SPACE x y z # Lorenz attractor’s phase space is x-y-z
end_time = 40 # we go from t=0 to 40 non-dimensional units
sigma = 10 # the original parameters from the 1963 paper
r = 28
b = 8/3
x_0 = -11 # initial conditions
y_0 = -16
z_0 = 22.5
# the dynamical system's equations written as naturally as possible
x_dot = sigma*(y - x)
y_dot = x*(r - z) - y
z_dot = x*y - b*z
PRINT t x y z # four-column plain-ASCII output
[Figure 2: The Lorenz attractor solved with FeenoX and drawn with
Gnuplot]
Figure 2: The Lorenz attractor solved with FeenoX and drawn with Gnuplot
Indeed, when executing FeenoX with this input file, we get four ASCII
columns (t, x, y and z) which we can then redirect to a file and plot it
with a standard tool such as Gnuplot. Note the importance of relying on
plain ASCII text formats both for input and output, as recommended by
the Unix philosophy and the rule of composition: other programs can
easily create inputs for FeenoX and other programs can easily understand
FeenoX’s outputs. This is essentially how Unix filters and pipes work.
Note the one-to-one correspondence between the human-friendly
differential equations (written in TeX and rendered as typesetted
mathematical symbols) and the computer-friendly input file that FeenoX
reads.
Let us solve the linear elasticity benchmark problem NAFEMS LE10 “Thick
plate pressure.” with FeenoX. Note the one-to-one correspondence between
the human-friendly problem statement from fig. 3 and the FeenoX input
file:
[Figure 3: The NAFEMS LE10 problem statement and the corresponding
FeenoX input]
Figure 3: The NAFEMS LE10 problem statement and the corresponding FeenoX
input
# NAFEMS Benchmark LE-10: thick plate pressure
PROBLEM mechanical DIMENSIONS 3
READ_MESH nafems-le10.msh # mesh in millimeters
# LOADING: uniform normal pressure on the upper surface
BC upper p=1 # 1 Mpa
# BOUNDARY CONDITIONS:
BC DCD'C' v=0 # Face DCD'C' zero y-displacement
BC ABA'B' u=0 # Face ABA'B' zero x-displacement
BC BCB'C' u=0 v=0 # Face BCB'C' x and y displ. fixed
BC midplane w=0 # z displacements fixed along mid-plane
# MATERIAL PROPERTIES: isotropic single-material properties
E = 210e3 # Young modulus in MPa
nu = 0.3 # Poisson's ratio
SOLVE_PROBLEM # solve!
# print the direct stress y at D (and nothing more)
PRINT "σ_y @ D = " sigmay(2000,0,300) "MPa"
Here, “one-to-one” means that the input file does not need any extra
definition which is not part of the problem formulation. Of course the
cognizant engineer can give further definitions such as
- the linear solver and pre-conditioner
- the tolerances for iterative solvers
- options for computing stresses out of displacements
- etc.
However, she is not obliged to as–at least for simple problems—the
defaults are reasonable. This is akin to writing a text in Markdown
where one does not need to care if the page is A4 or letter (as, in most
cases, the output will not be printed but rendered in a web browser).
The problem asks for the normal stress in the y direction σ_(y) at
point “D,” which is what FeenoX writes (and nothing else, rule of
economy):
$ feenox nafems-le10.fee
sigma_y @ D = -5.38016 MPa
$
Also note that since there is only one material, there is no need to do
an explicit link between material properties and physical volumes in the
mesh (rule of simplicity). And since the properties are uniform and
isotropic, a single global scalar for E and a global single scalar for ν
are enough.
[Figure 4: Normal stress σ_(y) refined around point D over 5,000x-warped
displacements for LE10 created with Paraview]
Figure 4: Normal stress σ_(y) refined around point D over 5,000x-warped
displacements for LE10 created with Paraview
For the sake of visual completeness, post-processing data with the
scalar distribution of σ_(y) and the vector field of displacements
[u, v, w] can be created by adding one line to the input file:
WRITE_MESH nafems-le10.vtk sigmay VECTOR u v w
This VTK file can then be post-processed to create interactive 3D views,
still screenshots, browser and mobile-friendly webGL models, etc. In
particular, using Paraview one can get a colorful bitmapped PNG (the
displacements are far more interesting than the stresses in this
problem).
[Figure 5: See also https://caeplex.com/r/f1a82f to see this very same
LE10 problem solved in the mobile-friendly web-based interface CAEplex
that uses FeenoX as the back end]
Figure 5: See also https://caeplex.com/r/f1a82f to see this very same
LE10 problem solved in the mobile-friendly web-based interface CAEplex
that uses FeenoX as the back end
Please note the following two points about both cases above:
1. The input files are very similar to the statements of each problem
in plain English words (rule of clarity). Those with some experience
may want to compare them to the inputs decks (sic) needed for other
common FEA programs.
2. By design, 100% of FeenoX’s output is controlled by the user. Had
there not been any PRINT or WRITE_MESH instructions, the output
would have been empty, following the rule of silence. This is a
significant change with respect to traditional engineering codes
that date back from times when one CPU hour was worth dozens (or
even hundreds) of engineering hours. At that time, cognizant
engineers had to dig into thousands of lines of data to search for a
single individual result. Nowadays, following the rule of economy,
it is actually far easier to ask the code to write only what is
needed in the particular format that suits the user.
Some basic rules are
- FeenoX is just a solver working as a transfer function between input
and output files.
+------------+
mesh (*.msh) } | | { terminal
data (*.dat) } input ----> | FeenoX |----> output { data files
input (*.fee) } | | { post (vtk/msh)
+------------+
Following the rules of separation, parsimony and diversity, there is
no embedded graphical interface but means of using generic pre and
post processing tools—in particular, Gmsh and Paraview respectively.
See also CAEplex for a web-based interface.
- The input files should be syntactically sugared so as to be as
self-describing as possible.
- Simple problems ought to need simple input files.
- Similar problems ought to need similar input files.
- Everything is an expression. Whenever a number is expected, an
algebraic expression can be entered as well. Variables, vectors,
matrices and functions are supported. Here is how to replace the
boundary condition on the right side of the slab above with a
radiation condition:
sigma = 1 # non-dimensional stefan-boltzmann constant
e = 0.8 # emissivity
Tinf=1 # non-dimensional reference temperature
BC right q=sigma*e*(Tinf^4-T(x)^4)
This “everything is an expression” principle directly allows the
application of the Method of Manufactured Solutions for code
verification.
- FeenoX should run natively in the cloud and be able to massively
scale in parallel. See the Software Requirements Specification and
the Software Development Specification for details.
Since it is free (as in freedom) and open source, contributions to add
features (and to fix bugs) are welcome. In particular, each kind of
problem supported by FeenoX (thermal, mechanical, modal, etc.) has a
subdirectory of source files which can be used as a template to add new
problems, as implied in the “community-contributed problems” bullet
above (rules of modularity and extensibility). See the documentation for
details about how to contribute.
[dynamical systems written as sets of ODEs/DAEs]: https://seamplex.com/feenox/examples/daes.html
[steady or transient heat conduction problems]: https://seamplex.com/feenox/examples/thermal.html
[steady or quasi-static thermo-mechanical problems]: https://seamplex.com/feenox/examples/mechanical.html
[modal analysis problems]: https://seamplex.com/feenox/examples/modal.html
[core-level steady-state neutronics]: https://seamplex.com/feenox/examples/neutron_diffusion.html
[Gmsh]: http://gmsh.info/
[Meshio]: https://github.com/nschloe/meshio
[Git]: https://git-scm.com/
[Lorenz’s dynamical system]: https://www.seamplex.com/feenox/examples/daes.html#lorenz-attractorthe-one-with-the-butterfly
[Gnuplot]: http://www.gnuplot.info/
[Deterministic non-periodic flow]: http://journals.ametsoc.org/doi/abs/10.1175/1520-0469%281963%29020%3C0130%3ADNF%3E2.0.CO%3B2
[Figure 2: The Lorenz attractor solved with FeenoX and drawn with Gnuplot]:
lorenz.svg
[1]: (http://www.gnuplot.info/)
[NAFEMS LE10 “Thick plate pressure.”]: https://www.seamplex.com/feenox/examples/mechanical.html#nafems-le10-thick-plate-pressure-benchmark
[Figure 3: The NAFEMS LE10 problem statement and the corresponding FeenoX input]:
nafems-le10-problem-input.svg
[Figure 4: Normal stress σ_(y) refined around point D over 5,000x-warped displacements for LE10 created with Paraview]:
nafems-le10.png
[2]: https://www.paraview.org
[Figure 5: See also https://caeplex.com/r/f1a82f to see this very same LE10 problem solved in the mobile-friendly web-based interface CAEplex that uses FeenoX as the back end]:
nafems-le10-caeplex.png
[Paraview]: https://www.paraview.org/
[CAEplex]: www.caeplex.com
[syntactically sugared]: https://en.wikipedia.org/wiki/Syntactic_sugar
[Software Requirements Specification]: doc/sds.md
[as in freedom]: https://www.gnu.org/philosophy/free-sw.en.html
[documentation]: doc
Running feenox
Invocation
The format for running the feenox program is:
feenox [options] inputfile [optional_extra_arguments] ...
The feenox executable supports the following options:
feenox [options] inputfile [replacement arguments] [petsc options]
-h, --help
display options and detailed explanations of command-line usage
-v, --version
display brief version information and exit
-V, --versions
display detailed version information
-c, --check
validates if the input file is sane or not
--pdes
list the types of PROBLEMs that FeenoX can solve, one per line
--elements_info
output a document with information about the supported element types
--ast
dump an abstract syntax tree of the input
--linear
force FeenoX to solve the PDE problem as linear
--non-linear
force FeenoX to solve the PDE problem as non-linear
--progress
print ASCII progress bars when solving PDEs
--mumps
ask PETSc to use the direct linear solver MUMPS
Instructions will be read from standard input if “-” is passed as
inputfile, i.e.
$ echo 'PRINT 2+2' | feenox -
4
The optional [replacement arguments] part of the command line mean that
each argument after the input file that does not start with an hyphen
will be expanded verbatim in the input file in each occurrence of $1,
$2, etc. For example
$ echo 'PRINT $1+$2' | feenox - 3 4
7
PETSc and SLEPc options can be passed in [petsc options] (or [options])
as well, with the difference that two hyphens have to be used instead of
only once. For example, to pass the PETSc option -ksp_view the actual
FeenoX invocation should be
$ feenox input.fee --ksp_view
For PETSc options that take values, en equal sign has to be used:
$ feenox input.fee --mg_levels_pc_type=sor
See https://www.seamplex.com/feenox/examples for annotated examples.
Compilation
These detailed compilation instructions are aimed at amd64 Debian-based
GNU/Linux distributions. The compilation procedure follows the POSIX
standard, so it should work in other operating systems and architectures
as well. Distributions not using apt for packages (i.e. yum) should
change the package installation commands (and possibly the package
names). The instructions should also work for in MacOS, although the
apt-get commands should be replaced by brew or similar. Same for Windows
under Cygwin, the packages should be installed through the Cygwin
installer. WSL was not tested, but should work as well.
[POSIX standard]: https://en.wikipedia.org/wiki/POSIX
[Cygwin]: https://www.cygwin.com/
Quickstart
Note that the quickest way to get started is to download an
already-compiled statically-linked binary executable. Note that getting
a binary is the quickest and easiest way to go but it is the less
flexible one. Mind the following instructions if a binary-only option is
not suitable for your workflow and/or you do need to compile the source
code from scratch.
On a GNU/Linux box (preferably Debian-based), follow these quick steps.
See sec. 3.2.2 for the actual detailed explanations.
To compile the Git repository, proceed as follows. This procedure does
need git and autoconf but new versions can be pulled and recompiled
easily. If something goes wrong and you get an error, do not hesitate to
ask in FeenoX’s discussion page.
1. Install mandatory dependencies
sudo apt-get update
sudo apt-get install git build-essential make automake autoconf libgsl-dev
If you cannot install libgsl-dev but still have git and the build
toolchain, you can have the configure script to download and compile
it for you. See point 4 below.
2. Install optional dependencies (of course these are optional but
recommended)
sudo apt-get install libsundials-dev petsc-dev slepc-dev
3. Clone Github repository
git clone https://github.com/seamplex/feenox
4. Bootstrap, configure, compile & make
cd feenox
./autogen.sh
./configure
make -j4
If you cannot (or do not want to) use libgsl-dev from a package
repository, call configure with --enable-download-gsl:
./configure --enable-download-gsl
If you do not have Internet access, get the tarball manually, copy
it to the same directory as configure and run again. See the
detailed compilation instructions for an explanation.
5. Run test suite (optional)
make check
6. Install the binary system wide (optional)
sudo make install
To stay up to date, pull and then autogen, configure and make (and
optionally install):
git pull
./autogen.sh; ./configure; make -j4
sudo make install
[download]: https://www.seamplex.com/feenox/#download
[discussion page]: https://github.com/seamplex/feenox/discussions
[detailed compilation instructions]: compilation.md
Detailed configuration and compilation
The main target and development environment is Debian GNU/Linux,
although it should be possible to compile FeenoX in any free GNU/Linux
variant (and even the in non-free MacOS and/or Windows platforms)
running in virtually any hardware platform. FeenoX can run be run either
in HPC cloud servers or a Raspberry Pi, and almost everything that sits
in the middle.
Following the Unix philosophy discussed in the SDS, FeenoX re-uses a lot
of already-existing high-quality free and open source libraries that
implement a wide variety of mathematical operations. This leads to a
number of dependencies that FeenoX needs in order to implement certain
features.
There is only one dependency that is mandatory, namely GNU GSL
(see sec. 3.2.2.1.1), which if it not found then FeenoX cannot be
compiled. All other dependencies are optional, meaning that FeenoX can
be compiled but its capabilities will be partially reduced.
As per the SRS, all dependencies have to be available on mainstream
GNU/Linux distributions and have to be free and open source software.
But they can also be compiled from source in case the package
repositories are not available or customized compilation flags are
needed (i.e. optimization or debugging settings).
In particular, PETSc (and SLEPc) also depend on other mathematical
libraries to perform particular operations such as low-level linear
algebra operations. These extra dependencies can be either free (such as
LAPACK) or non-free (such as Intel’s MKL), but there is always at least
one combination of a working setup that involves only free and open
source software which is compatible with FeenoX licensing terms
(GPLv3+). See the documentation of each package for licensing details.
[Debian GNU/Linux]: https://www.debian.org/
[SDS]: SDS.md
[GNU GSL]: https://www.gnu.org/software/gsl/
[SRS]: SRS.md
[PETSc]: https://petsc.org/release/
[SLEPc]: https://slepc.upv.es/
[LAPACK]: http://www.netlib.org/lapack/
[Intel’s MKL]: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html
Mandatory dependencies
FeenoX has one mandatory dependency for run-time execution and the
standard build toolchain for compilation. It is written in C99 so only a
C compiler is needed, although make is also required. Free and open
source compilers are favored. The usual C compiler is gcc but clang or
Intel’s icc and the newer icx can also be used.
Note that there is no need to have a Fortran nor a C++ compiler to build
FeenoX. They might be needed to build other dependencies (such as PETSc
and its dependencies), but not to compile FeenoX if all the dependencies
are installed from the operating system’s package repositories. In case
the build toolchain is not already installed, do so with
sudo apt-get install gcc make
If the source is to be fetched from the Git repository then not only is
git needed but also autoconf and automake since the configure script is
not stored in the Git repository but the autogen.sh script that
bootstraps the tree and creates it. So if instead of compiling a source
tarball one wants to clone from GitHub, these packages are also
mandatory:
sudo apt-get install git automake autoconf
Again, chances are that any existing GNU/Linux box has all these tools
already installed.
[Git repository]: https://github.com/seamplex/feenox/
The GNU Scientific Library
The only run-time dependency is GNU GSL (not to be confused with
Microsoft GSL). It can be installed with
sudo apt-get install libgsl-dev
In case this package is not available or you do not have enough
permissions to install system-wide packages, there are two options.
1. Pass the option --enable-download-gsl to the configure script below.
2. Manually download, compile and install GNU GSL
If the configure script cannot find both the headers and the actual
library, it will refuse to proceed. Note that the FeenoX binaries
already contain a static version of the GSL so it is not needed to have
it installed in order to run the statically-linked binaries.
[GNU GSL]: https://www.gnu.org/software/gsl/
[Microsoft GSL]: https://github.com/microsoft/GSL
Optional dependencies
FeenoX has three optional run-time dependencies. It can be compiled
without any of these, but functionality will be reduced:
- SUNDIALS provides support for solving systems of ordinary
differential equations (ODEs) or differential-algebraic equations
(DAEs). This dependency is needed when running inputs with the
PHASE_SPACE keyword.
- PETSc provides support for solving partial differential equations
(PDEs). This dependency is needed when running inputs with the
PROBLEM keyword.
- SLEPc provides support for solving eigen-value problems in partial
differential equations (PDEs). This dependency is needed for inputs
with PROBLEM types with eigen-value formulations such as modal and
neutron_sn.
In absence of all these, FeenoX can still be used to
- solve general mathematical problems such as the ones to compute the
Fibonacci sequence or the Logistic map,
- operate on functions, either algebraically or point-wise
interpolated such as Computing the derivative of a function as a
Unix filter
- read, operate over and write meshes,
- etc.
These optional dependencies have to be installed separately. There is no
option to have configure to download them as with --enable-download-gsl.
When running the test suite (sec. 3.2.2.6), those tests that need an
optional dependency which was not found at compile time will be skipped.
[SUNDIALS]: https://computing.llnl.gov/projects/sundials
[3]: https://petsc.org/
[SLEPc]: https://slepc.upv.es/
[Fibonacci sequence]: https://www.seamplex.com/feenox/examples/#the-fibonacci-sequence
[Logistic map]: https://www.seamplex.com/feenox/examples/#the-logistic-map
[Computing the derivative of a function as a Unix filter]: https://www.seamplex.com/feenox/examples/#computing-the-derivative-of-a-function-as-a-unix-filter
SUNDIALS
SUNDIALS is a SUite of Nonlinear and DIfferential/ALgebraic equation
Solvers. It is used by FeenoX to solve dynamical systems casted as DAEs
with the keyword PHASE_SPACE, like the Lorenz system.
Install either by doing
sudo apt-get install libsundials-dev
or by following the instructions in the documentation.
[SUNDIALS]: https://computing.llnl.gov/projects/sundials
[PHASE_SPACE]: https://www.seamplex.com/feenox/doc/feenox-manual.html#phase_space
[the Lorenz system]: https://www.seamplex.com/feenox/examples/#lorenz-attractor-the-one-with-the-butterfly
PETSc
The Portable, Extensible Toolkit for Scientific Computation, pronounced
PET-see (/ˈpɛt-siː/), is a suite of data structures and routines for the
scalable (parallel) solution of scientific applications modeled by
partial differential equations. It is used by FeenoX to solve PDEs with
the keyword PROBLEM, like the NAFEMS LE10 benchmark problem.
Install either by doing
sudo apt-get install petsc-dev
or by following the instructions in the documentation.
Note that
- Configuring and compiling PETSc from scratch might be difficult the
first time. It has a lot of dependencies and options. Read the
official documentation for a detailed explanation.
- There is a huge difference in efficiency between using PETSc
compiled with debugging symbols and with optimization flags. Make
sure to configure --with-debugging=0 for FeenoX production runs and
leave the debugging symbols (which is the default) for development
and debugging only.
- FeenoX needs PETSc to be configured with real double-precision
scalars. It will compile but will complain at run-time when using
complex and/or single or quad-precision scalars.
- FeenoX honors the PETSC_DIR and PETSC_ARCH environment variables
when executing configure. If these two do not exist or are empty, it
will try to use the default system-wide locations (i.e. the
petsc-dev package).
[Portable, Extensible Toolkit for Scientific Computation]: (https://petsc.org/)
[PROBLEM]: https://www.seamplex.com/feenox/doc/feenox-manual.html#problem
[NAFEMS LE10 benchmark problem]: https://www.seamplex.com/feenox/examples/#nafems-le10-thick-plate-pressure-benchmark
[4]: https://petsc.org/release/install/
SLEPc
The Scalable Library for Eigenvalue Problem Computations, is a software
library for the solution of large scale sparse eigenvalue problems on
parallel computers. It is used by FeenoX to solve PDEs with the keyword
PROBLEM that need eigen-value computations, such as modal analysis of a
cantilevered beam.
Install either by doing
sudo apt-get install slepc-dev
or by following the instructions in the documentation.
Note that
- SLEPc is an extension of PETSc so the latter has to be already
installed and configured.
- FeenoX honors the SLEPC_DIR environment variable when executing
configure. If it does not exist or is empty it will try to use the
default system-wide locations (i.e. the slepc-dev package).
- If PETSc was configured with --download-slepc then the SLEPC_DIR
variable has to be set to the directory inside PETSC_DIR where SLEPc
was cloned and compiled.
[Scalable Library for Eigenvalue Problem Computations]: https://slepc.upv.es/
[PROBLEM]: https://www.seamplex.com/feenox/doc/feenox-manual.html#problem
[modal analysis of a cantilevered beam]: https://www.seamplex.com/feenox/examples/#five-natural-modes-of-a-cantilevered-wire
FeenoX source code
There are two ways of getting FeenoX’s source code:
1. Cloning the GitHub repository at https://github.com/seamplex/feenox
2. Downloading a source tarball from
https://seamplex.com/feenox/dist/src/
Git repository
The main Git repository is hosted on GitHub at
https://github.com/seamplex/feenox. It is public so it can be cloned
either through HTTPS or SSH without needing any particular credentials.
It can also be forked freely. See the Programming Guide for details
about pull requests and/or write access to the main repository.
Ideally, the main branch should have a usable snapshot. All other
branches can contain code that might not compile or might not run or
might not be tested. If you find a commit in the main branch that does
not pass the tests, please report it in the issue tracker ASAP.
After cloning the repository
git clone https://github.com/seamplex/feenox
the autogen.sh script has to be called to bootstrap the working tree,
since the configure script is not stored in the repository but created
from configure.ac (which is in the repository) by autogen.sh.
Similarly, after updating the working tree with
git pull
it is recommended to re-run the autogen.sh script. It will do a
make clean and re-compute the version string.
[Programming Guide]: programming.md
Source tarballs
When downloading a source tarball, there is no need to run autogen.sh
since the configure script is already included in the tarball. This
method cannot update the working tree. For each new FeenoX release, the
whole source tarball has to be downloaded again.
Configuration
To create a proper Makefile for the particular architecture,
dependencies and compilation options, the script configure has to be
executed. This procedure follows the GNU Coding Standards.
./configure
Without any particular options, configure will check if the mandatory
GNU Scientific Library is available (both its headers and run-time
library). If it is not, then the option --enable-download-gsl can be
used. This option will try to use wget (which should be installed) to
download a source tarball, uncompress, configure and compile it. If
these steps are successful, this GSL will be statically linked into the
resulting FeenoX executable. If there is no internet connection, the
configure script will say that the download failed. In that case, get
the indicated tarball file manually, copy it into the current directory
and re-run ./configure.
The script will also check for the availability of optional
dependencies. At the end of the execution, a summary of what was found
(or not) is printed in the standard output:
$ ./configure
[...]
## ----------------------- ##
## Summary of dependencies ##
## ----------------------- ##
GNU Scientific Library from system
SUNDIALS IDA yes
PETSc yes /usr/lib/petsc
SLEPc no
[...]
If for some reason one of the optional dependencies is available but
FeenoX should not use it, then pass --without-sundials, --without-petsc
and/or --without-slepc as arguments. For example
$ ./configure --without-sundials --without-petsc
[...]
## ----------------------- ##
## Summary of dependencies ##
## ----------------------- ##
GNU Scientific Library from system
SUNDIALS no
PETSc no
SLEPc no
[...]
If configure complains about contradicting values from the cached ones,
run autogen.sh again before configure and/or clone/uncompress the source
tarball in a fresh location.
To see all the available options run
./configure --help
[GNU Coding Standards]: https://www.gnu.org/prep/standards/
[GNU Scientific Library]: https://www.gnu.org/software/gsl/
Source code compilation
After the successful execution of configure, a Makefile is created. To
compile FeenoX, just execute
make
Compilation should take a dozen of seconds. It can be even sped up by
using the -j option
make -j8
The binary executable will be located in the src directory but a copy
will be made in the base directory as well. Test it by running without
any arguments
$ ./feenox
FeenoX v0.2.14-gbbf48c9
a free no-fee no-X uniX-like finite-element(ish) computational engineering tool
usage: feenox [options] inputfile [replacement arguments] [petsc options]
-h, --help display options and detailed explanations of command-line usage
-v, --version display brief version information and exit
-V, --versions display detailed version information
Run with --help for further explanations.
$
The -v (or --version) option shows the version and a copyright notice:
$ ./feenox -v
FeenoX v0.2.14-gbbf48c9
a free no-fee no-X uniX-like finite-element(ish) computational engineering tool
Copyright © 2009--2022 https://seamplex.com/feenox
GNU General Public License v3+, https://www.gnu.org/licenses/gpl.html.
FeenoX is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$
The -V (or --versions) option shows the dates of the last commits, the
compiler options and the versions of the linked libraries:
$ ./feenox -V
FeenoX v0.1.24-g6cfe063
a free no-fee no-X uniX-like finite-element(ish) computational engineering tool
Last commit date : Sun Aug 29 11:34:04 2021 -0300
Build date : Sun Aug 29 11:44:50 2021 -0300
Build architecture : linux-gnu x86_64
Compiler version : gcc (Debian 10.2.1-6) 10.2.1 20210110
Compiler expansion : gcc -Wl,-z,relro -I/usr/include/x86_64-linux-gnu/mpich -L/usr/lib/x86_64-linux-gnu -lmpich
Compiler flags : -O3
Builder : gtheler@chalmers
GSL version : 2.6
SUNDIALS version : 4.1.0
PETSc version : Petsc Release Version 3.14.5, Mar 03, 2021
PETSc arch :
PETSc options : --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --with-option-checking=0 --with-silent-rules=0 --libdir=${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --with-maintainer-mode=0 --with-dependency-tracking=0 --with-debugging=0 --shared-library-extension=_real --with-shared-libraries --with-pic=1 --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 --with-cxx-dialect=C++11 --with-opencl=1 --with-blas-lib=-lblas --with-lapack-lib=-llapack --with-scalapack=1 --with-scalapack-lib=-lscalapack-openmpi --with-ptscotch=1 --with-ptscotch-include=/usr/include/scotch --with-ptscotch-lib="-lptesmumps -lptscotch -lptscotcherr" --with-fftw=1 --with-fftw-include="[]" --with-fftw-lib="-lfftw3 -lfftw3_mpi" --with-superlu_dist=1 --with-superlu_dist-include=/usr/include/superlu-dist --with-superlu_dist-lib=-lsuperlu_dist --with-hdf5-include=/usr/include/hdf5/openmpi --with-hdf5-lib="-L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lhdf5 -lmpi" --CXX_LINKER_FLAGS=-Wl,--no-as-needed --with-hypre=1 --with-hypre-include=/usr/include/hypre --with-hypre-lib=-lHYPRE_core --with-mumps=1 --with-mumps-include="[]" --with-mumps-lib="-ldmumps -lzmumps -lsmumps -lcmumps -lmumps_common -lpord" --with-suitesparse=1 --with-suitesparse-include=/usr/include/suitesparse --with-suitesparse-lib="-lumfpack -lamd -lcholmod -lklu" --with-superlu=1 --with-superlu-include=/usr/include/superlu --with-superlu-lib=-lsuperlu --prefix=/usr/lib/petscdir/petsc3.14/x86_64-linux-gnu-real --PETSC_ARCH=x86_64-linux-gnu-real CFLAGS="-g -O2 -ffile-prefix-map=/build/petsc-pVufYp/petsc-3.14.5+dfsg1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC" CXXFLAGS="-g -O2 -ffile-prefix-map=/build/petsc-pVufYp/petsc-3.14.5+dfsg1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC" FCFLAGS="-g -O2 -ffile-prefix-map=/build/petsc-pVufYp/petsc-3.14.5+dfsg1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fPIC -ffree-line-length-0" FFLAGS="-g -O2 -ffile-prefix-map=/build/petsc-pVufYp/petsc-3.14.5+dfsg1=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fPIC -ffree-line-length-0" CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2" LDFLAGS="-Wl,-Bsymbolic-functions -flto=auto -Wl,-z,relro -fPIC" MAKEFLAGS=w
SLEPc version : SLEPc Release Version 3.14.2, Feb 01, 2021
$
Test suite
The test directory contains a set of test cases whose output is known so
that unintended regressions can be detected quickly (see the programming
guide for more information). The test suite ought to be run after each
modification in FeenoX’s source code. It consists of a set of scripts
and input files needed to solve dozens of cases. The output of each
execution is compared to a reference solution. In case the output does
not match the reference, the test suite fails.
After compiling FeenoX as explained in sec. 3.2.2.5, the test suite can
be run with make check. Ideally everything should be green meaning the
tests passed:
$ make check
Making check in src
make[1]: Entering directory '/home/gtheler/codigos/feenox/src'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/gtheler/codigos/feenox/src'
make[1]: Entering directory '/home/gtheler/codigos/feenox'
cp -r src/feenox .
make check-TESTS
make[2]: Entering directory '/home/gtheler/codigos/feenox'
make[3]: Entering directory '/home/gtheler/codigos/feenox'
XFAIL: tests/abort.sh
PASS: tests/algebraic_expr.sh
PASS: tests/beam-modal.sh
PASS: tests/beam-ortho.sh
PASS: tests/builtin.sh
PASS: tests/cylinder-traction-force.sh
PASS: tests/default_argument_value.sh
PASS: tests/expressions_constants.sh
PASS: tests/expressions_variables.sh
PASS: tests/expressions_functions.sh
PASS: tests/exp.sh
PASS: tests/i-beam-euler-bernoulli.sh
PASS: tests/iaea-pwr.sh
PASS: tests/iterative.sh
PASS: tests/fit.sh
PASS: tests/function_algebraic.sh
PASS: tests/function_data.sh
PASS: tests/function_file.sh
PASS: tests/function_vectors.sh
PASS: tests/integral.sh
PASS: tests/laplace2d.sh
PASS: tests/materials.sh
PASS: tests/mesh.sh
PASS: tests/moment-of-inertia.sh
PASS: tests/nafems-le1.sh
PASS: tests/nafems-le10.sh
PASS: tests/nafems-le11.sh
PASS: tests/nafems-t1-4.sh
PASS: tests/nafems-t2-3.sh
PASS: tests/neutron_diffusion_src.sh
PASS: tests/neutron_diffusion_keff.sh
PASS: tests/parallelepiped.sh
PASS: tests/point-kinetics.sh
PASS: tests/print.sh
PASS: tests/thermal-1d.sh
PASS: tests/thermal-2d.sh
PASS: tests/trig.sh
PASS: tests/two-cubes-isotropic.sh
PASS: tests/two-cubes-orthotropic.sh
PASS: tests/vector.sh
XFAIL: tests/xfail-few-properties-ortho-young.sh
XFAIL: tests/xfail-few-properties-ortho-poisson.sh
XFAIL: tests/xfail-few-properties-ortho-shear.sh
============================================================================
Testsuite summary for feenox v0.2.6-g3237ce9
============================================================================
# TOTAL: 43
# PASS: 39
# SKIP: 0
# XFAIL: 4
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/home/gtheler/codigos/feenox'
make[2]: Leaving directory '/home/gtheler/codigos/feenox'
make[1]: Leaving directory '/home/gtheler/codigos/feenox'
$
The XFAIL result means that those cases are expected to fail (they are
there to test if FeenoX can handle errors). Failure would mean they
passed. In case FeenoX was not compiled with any optional dependency,
the corresponding tests will be skipped. Skipped tests do not mean any
failure, but that the compiled FeenoX executable does not have the full
capabilities. For example, when configuring with
./configure --without-petsc (but with SUNDIALS), the test suite output
should be a mixture of green and blue:
$ ./configure --without-petsc
[...]
configure: creating ./src/version.h
## ----------------------- ##
## Summary of dependencies ##
## ----------------------- ##
GNU Scientific Library from system
SUNDIALS yes
PETSc no
SLEPc no
Compiler gcc
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: executing depfiles commands
$ make
[...]
$ make check
Making check in src
make[1]: Entering directory '/home/gtheler/codigos/feenox/src'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/gtheler/codigos/feenox/src'
make[1]: Entering directory '/home/gtheler/codigos/feenox'
cp -r src/feenox .
make check-TESTS
make[2]: Entering directory '/home/gtheler/codigos/feenox'
make[3]: Entering directory '/home/gtheler/codigos/feenox'
XFAIL: tests/abort.sh
PASS: tests/algebraic_expr.sh
SKIP: tests/beam-modal.sh
SKIP: tests/beam-ortho.sh
PASS: tests/builtin.sh
SKIP: tests/cylinder-traction-force.sh
PASS: tests/default_argument_value.sh
PASS: tests/expressions_constants.sh
PASS: tests/expressions_variables.sh
PASS: tests/expressions_functions.sh
PASS: tests/exp.sh
SKIP: tests/i-beam-euler-bernoulli.sh
SKIP: tests/iaea-pwr.sh
PASS: tests/iterative.sh
PASS: tests/fit.sh
PASS: tests/function_algebraic.sh
PASS: tests/function_data.sh
PASS: tests/function_file.sh
PASS: tests/function_vectors.sh
PASS: tests/integral.sh
SKIP: tests/laplace2d.sh
PASS: tests/materials.sh
PASS: tests/mesh.sh
PASS: tests/moment-of-inertia.sh
SKIP: tests/nafems-le1.sh
SKIP: tests/nafems-le10.sh
SKIP: tests/nafems-le11.sh
SKIP: tests/nafems-t1-4.sh
SKIP: tests/nafems-t2-3.sh
SKIP: tests/neutron_diffusion_src.sh
SKIP: tests/neutron_diffusion_keff.sh
SKIP: tests/parallelepiped.sh
PASS: tests/point-kinetics.sh
PASS: tests/print.sh
SKIP: tests/thermal-1d.sh
SKIP: tests/thermal-2d.sh
PASS: tests/trig.sh
SKIP: tests/two-cubes-isotropic.sh
SKIP: tests/two-cubes-orthotropic.sh
PASS: tests/vector.sh
SKIP: tests/xfail-few-properties-ortho-young.sh
SKIP: tests/xfail-few-properties-ortho-poisson.sh
SKIP: tests/xfail-few-properties-ortho-shear.sh
============================================================================
Testsuite summary for feenox v0.2.6-g3237ce9
============================================================================
# TOTAL: 43
# PASS: 21
# SKIP: 21
# XFAIL: 1
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/home/gtheler/codigos/feenox'
make[2]: Leaving directory '/home/gtheler/codigos/feenox'
make[1]: Leaving directory '/home/gtheler/codigos/feenox'
$
To illustrate how regressions can be detected, let us add a bug
deliberately and re-run the test suite.
Edit the source file that contains the shape functions of the
second-order tetrahedra src/mesh/tet10.c, find the function
feenox_mesh_tet10_h() and randomly change a sign, i.e. replace
return t*(2*t-1);
with
return t*(2*t+1);
Save, recompile, and re-run the test suite to obtain some red:
$ git diff src/mesh/
diff --git a/src/mesh/tet10.c b/src/mesh/tet10.c
index 72bc838..293c290 100644
--- a/src/mesh/tet10.c
+++ b/src/mesh/tet10.c
@@ -227,7 +227,7 @@ double feenox_mesh_tet10_h(int j, double *vec_r) {
return s*(2*s-1);
break;
case 3:
- return t*(2*t-1);
+ return t*(2*t+1);
break;
case 4:
$ make
[...]
$ make check
Making check in src
make[1]: Entering directory '/home/gtheler/codigos/feenox/src'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/gtheler/codigos/feenox/src'
make[1]: Entering directory '/home/gtheler/codigos/feenox'
cp -r src/feenox .
make check-TESTS
make[2]: Entering directory '/home/gtheler/codigos/feenox'
make[3]: Entering directory '/home/gtheler/codigos/feenox'
XFAIL: tests/abort.sh
PASS: tests/algebraic_expr.sh
FAIL: tests/beam-modal.sh
PASS: tests/beam-ortho.sh
PASS: tests/builtin.sh
PASS: tests/cylinder-traction-force.sh
PASS: tests/default_argument_value.sh
PASS: tests/expressions_constants.sh
PASS: tests/expressions_variables.sh
PASS: tests/expressions_functions.sh
PASS: tests/exp.sh
PASS: tests/i-beam-euler-bernoulli.sh
PASS: tests/iaea-pwr.sh
PASS: tests/iterative.sh
PASS: tests/fit.sh
PASS: tests/function_algebraic.sh
PASS: tests/function_data.sh
PASS: tests/function_file.sh
PASS: tests/function_vectors.sh
PASS: tests/integral.sh
PASS: tests/laplace2d.sh
PASS: tests/materials.sh
PASS: tests/mesh.sh
PASS: tests/moment-of-inertia.sh
PASS: tests/nafems-le1.sh
FAIL: tests/nafems-le10.sh
FAIL: tests/nafems-le11.sh
PASS: tests/nafems-t1-4.sh
PASS: tests/nafems-t2-3.sh
PASS: tests/neutron_diffusion_src.sh
PASS: tests/neutron_diffusion_keff.sh
FAIL: tests/parallelepiped.sh
PASS: tests/point-kinetics.sh
PASS: tests/print.sh
PASS: tests/thermal-1d.sh
PASS: tests/thermal-2d.sh
PASS: tests/trig.sh
PASS: tests/two-cubes-isotropic.sh
PASS: tests/two-cubes-orthotropic.sh
PASS: tests/vector.sh
XFAIL: tests/xfail-few-properties-ortho-young.sh
XFAIL: tests/xfail-few-properties-ortho-poisson.sh
XFAIL: tests/xfail-few-properties-ortho-shear.sh
============================================================================
Testsuite summary for feenox v0.2.6-g3237ce9
============================================================================
# TOTAL: 43
# PASS: 35
# SKIP: 0
# XFAIL: 4
# FAIL: 4
# XPASS: 0
# ERROR: 0
============================================================================
See ./test-suite.log
Please report to jeremy@seamplex.com
============================================================================
make[3]: *** [Makefile:1152: test-suite.log] Error 1
make[3]: Leaving directory '/home/gtheler/codigos/feenox'
make[2]: *** [Makefile:1260: check-TESTS] Error 2
make[2]: Leaving directory '/home/gtheler/codigos/feenox'
make[1]: *** [Makefile:1791: check-am] Error 2
make[1]: Leaving directory '/home/gtheler/codigos/feenox'
make: *** [Makefile:1037: check-recursive] Error 1
$
[test]: https://github.com/seamplex/feenox/tree/main/tests
[programming guide]: programming.md
Installation
To be able to execute FeenoX from any directory, the binary has to be
copied to a directory available in the PATH environment variable. If you
have root access, the easiest and cleanest way of doing this is by
calling make install with sudo or su:
$ sudo make install
Making install in src
make[1]: Entering directory '/home/gtheler/codigos/feenox/src'
gmake[2]: Entering directory '/home/gtheler/codigos/feenox/src'
/usr/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c feenox '/usr/local/bin'
gmake[2]: Nothing to be done for 'install-data-am'.
gmake[2]: Leaving directory '/home/gtheler/codigos/feenox/src'
make[1]: Leaving directory '/home/gtheler/codigos/feenox/src'
make[1]: Entering directory '/home/gtheler/codigos/feenox'
cp -r src/feenox .
make[2]: Entering directory '/home/gtheler/codigos/feenox'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/gtheler/codigos/feenox'
make[1]: Leaving directory '/home/gtheler/codigos/feenox'
$
If you do not have root access or do not want to populate
/usr/local/bin, you can either
- Configure with a different prefix (not covered here), or
- Copy (or symlink) the feenox executable to $HOME/bin:
mkdir -p ${HOME}/bin
cp feenox ${HOME}/bin
If you plan to regularly update FeenoX (which you should), you might
want to symlink instead of copy so you do not need to update the
binary in $HOME/bin each time you recompile:
mkdir -p ${HOME}/bin
ln -sf feenox ${HOME}/bin
Check that FeenoX is now available from any directory (note the command
is feenox and not ./feenox):
$ cd
$ feenox -v
FeenoX v0.2.14-gbbf48c9
a free no-fee no-X uniX-like finite-element(ish) computational engineering tool
Copyright © 2009--2022 https://seamplex.com/feenox
GNU General Public License v3+, https://www.gnu.org/licenses/gpl.html.
FeenoX is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$
If it is not and you went through the $HOME/bin path, make sure it is in
the PATH (pun). Add
export PATH=${PATH}:${HOME}/bin
to your .bashrc in your home directory and re-login.
Advanced settings
Compiling with debug symbols
By default the C flags are -O3, without debugging. To add the -g flag,
just use CFLAGS when configuring:
./configure CFLAGS="-g -O0"
Using a different compiler
FeenoX uses the CC environment variable to set the compiler. So
configure like
export CC=clang; ./configure
Note that the CC variable has to be exported and not passed to
configure. That is to say, don’t configure like
./configure CC=clang
Mind also the following environment variables when using MPI-enabled
PETSc:
- MPICH_CC
- OMPI_CC
- I_MPI_CC
Depending on how your system is configured, this last command might show
clang but not actually use it. The FeenoX executable will show the
configured compiler and flags when invoked with the --versions option:
$ feenox --versions
FeenoX v0.2.14-gbbf48c9
a free no-fee no-X uniX-like finite-element(ish) computational engineering tool
Last commit date : Sat Feb 12 15:35:05 2022 -0300
Build date : Sat Feb 12 15:35:44 2022 -0300
Build architecture : linux-gnu x86_64
Compiler version : gcc (Debian 10.2.1-6) 10.2.1 20210110
Compiler expansion : gcc -Wl,-z,relro -I/usr/include/x86_64-linux-gnu/mpich -L/usr/lib/x86_64-linux-gnu -lmpich
Compiler flags : -O3
Builder : gtheler@tom
GSL version : 2.6
SUNDIALS version : 5.7.0
PETSc version : Petsc Release Version 3.16.3, Jan 05, 2022
PETSc arch : arch-linux-c-debug
PETSc options : --download-eigen --download-hdf5 --download-hypre --download-metis --download-mumps --download-parmetis --download-pragmatic --download-scalapack
SLEPc version : SLEPc Release Version 3.16.1, Nov 17, 2021
$
You can check which compiler was actually used by analyzing the feenox
binary as
$ objdump -s --section .comment ./feenox
./feenox: file format elf64-x86-64
Contents of section .comment:
0000 4743433a 20284465 6269616e 2031322e GCC: (Debian 12.
0010 322e302d 31342920 31322e32 2e300044 2.0-14) 12.2.0.D
0020 65626961 6e20636c 616e6720 76657273 ebian clang vers
0030 696f6e20 31342e30 2e3600 ion 14.0.6.
$
It should be noted that the MPI implementation used to compile FeenoX
has to match the one used to compile PETSc. Therefore, if you compiled
PETSc on your own, it is up to you to ensure MPI compatibility. If you
are using PETSc as provided by your distribution’s repositories, you
will have to find out which one was used (it is usually OpenMPI) and use
the same one when compiling FeenoX. FeenoX has been tested using PETSc
compiled with
- MPICH
- OpenMPI
- Intel MPI
Compiling PETSc
Particular explanation for FeenoX is to be done. For now, follow the
general explanation from PETSc’s website.
export PETSC_DIR=$PWD
export PETSC_ARCH=arch-linux-c-opt
./configure --with-debugging=0 --download-mumps --download-scalapack --with-cxx=0 --COPTFLAGS=-O3 --FOPTFLAGS=-O3
export PETSC_DIR=$PWD
./configure --with-debugging=0 --with-openmp=0 --with-x=0 --with-cxx=0 --COPTFLAGS=-O3 --FOPTFLAGS=-O3
make PETSC_DIR=/home/ubuntu/reflex-deps/petsc-3.17.2 PETSC_ARCH=arch-linux-c-opt all
[general explanation from PETSc’s website]: https://petsc.org/release/install/
Examples
See https://www.seamplex.com/feenox/examples for updated information.
- Basic mathematics
- Hello World (and Universe)!
- Ten ways of computing π
- Financial decisions under inflation
- The logistic map
- The Fibonacci sequence
- Using the closed-form formula as a function
- Using a vector
- Solving an iterative problem
- Computing the derivative of a function as a Unix filter
- On the evaluation of thermal expansion coefficients
- Buffon’s needle
- Ordinary Differential Equations & Differential-Algebraic Equations
- Lorenz’ attractor—the one with the butterfly
- The double pendulum
- Vertical boiling channel
- Original Clausse-Lahey formulation with uniform power
distribution
- Arbitrary power distribution
- Reactor point kinetics
- Cinética puntual directa con reactividad vs. tiempo
- Cinética inversa
- Control de inestabilidades de xenón
- Mapas de diseño
- Laplace’s equation
- How to solve a maze without AI
- Transient top-down
- Transient bottom-up
- Potential flow around an airfoil profile
- Heat conduction
- Thermal slabs
- One-dimensional linear
- Transient heat conduction from steady-state by “turning off” BCs
- Non-dimensional transient heat conduction on a cylinder
- Non-dimensional transient heat conduction with time-dependent
properties
- Linear elasticity
- NAFEMS LE10 “Thick plate pressure” benchmark
- NAFEMS LE11 “Solid Cylinder/Taper/Sphere-Temperature” benchmark
- NAFEMS LE1 “Elliptical membrane” plane-stress benchmark
- Parametric study on a cantilevered beam
- Parallelepiped whose Young’s modulus is a function of the
temperature
- Thermal problem
- Mechanical problem
- Orthotropic free expansion of a cube
- Thermo-elastic expansion of finite cylinders
- Temperature-dependent material properties
- Two cubes compressing each other
- Mechanical modal analysis
- Optimizing the length of a tuning fork
- Five natural modes of a cantilevered wire
- Neutron diffusion
- IAEA 2D PWR Benchmark
- IAEA 3D PWR Benchmark
- Cube-spherical bare reactor
- Illustration of the XS dilution & smearing effect
- Neutron transport using S_(N)
- Reed’s problem
- Azmy’s problem
- Second-order complete structured rectangular grid
- Fist-order locally-refined unstructured triangular grid
- Flux profiles with ray effect
[Hello World (and Universe)!]: https://seamplex.com/feenox/examples/basic.html#hello-world-and-universe
[Ten ways of computing π]: https://seamplex.com/feenox/examples/basic.html#ten-ways-of-computing-pi
[Financial decisions under inflation]: https://seamplex.com/feenox/examples/basic.html#financial-decisions-under-inflation
[The logistic map]: https://seamplex.com/feenox/examples/basic.html#the-logistic-map
[The Fibonacci sequence]: https://seamplex.com/feenox/examples/basic.html#the-fibonacci-sequence
[Using the closed-form formula as a function]: https://seamplex.com/feenox/examples/basic.html#using-the-closed-form-formula-as-a-function
[Using a vector]: https://seamplex.com/feenox/examples/basic.html#using-a-vector
[Solving an iterative problem]: https://seamplex.com/feenox/examples/basic.html#solving-an-iterative-problem
[5]: https://seamplex.com/feenox/examples/basic.html#computing-the-derivative-of-a-function-as-a-unix-filter
[On the evaluation of thermal expansion coefficients]: https://seamplex.com/feenox/examples/basic.html#on-the-evaluation-of-thermal-expansion-coefficients
[Buffon’s needle]: https://seamplex.com/feenox/examples/basic.html#buffons-needle
[Lorenz’ attractor—the one with the butterfly]: https://seamplex.com/feenox/examples/daes.html#lorenz-attractorthe-one-with-the-butterfly
[The double pendulum]: https://seamplex.com/feenox/examples/daes.html#the-double-pendulum
[Vertical boiling channel]: https://seamplex.com/feenox/examples/daes.html#vertical-boiling-channel
[Original Clausse-Lahey formulation with uniform power distribution]: https://seamplex.com/feenox/examples/daes.html#original-clausse-lahey-formulation-with-uniform-power-distribution
[Arbitrary power distribution]: https://seamplex.com/feenox/examples/daes.html#arbitrary-power-distribution
[Reactor point kinetics]: https://seamplex.com/feenox/examples/daes.html#reactor-point-kinetics
[Cinética puntual directa con reactividad vs. tiempo]: https://seamplex.com/feenox/examples/daes.html#cinética-puntual-directa-con-reactividad-vs.-tiempo
[Cinética inversa]: https://seamplex.com/feenox/examples/daes.html#cinética-inversa
[Control de inestabilidades de xenón]: https://seamplex.com/feenox/examples/daes.html#control-de-inestabilidades-de-xenón
[Mapas de diseño]: https://seamplex.com/feenox/examples/daes.html#mapas-de-diseño
[How to solve a maze without AI]: https://seamplex.com/feenox/examples/laplace.html#how-to-solve-a-maze-without-ai
[Transient top-down]: https://seamplex.com/feenox/examples/laplace.html#transient-top-down
[Transient bottom-up]: https://seamplex.com/feenox/examples/laplace.html#transient-bottom-up
[Potential flow around an airfoil profile]: https://seamplex.com/feenox/examples/laplace.html#potential-flow-around-an-airfoil-profile
[Thermal slabs]: https://seamplex.com/feenox/examples/thermal.html#thermal-slabs
[One-dimensional linear]: https://seamplex.com/feenox/examples/thermal.html#one-dimensional-linear
[Transient heat conduction from steady-state by “turning off” BCs]: https://seamplex.com/feenox/examples/thermal.html#transient-heat-conduction-from-steady-state-by-turning-off-bcs
[Non-dimensional transient heat conduction on a cylinder]: https://seamplex.com/feenox/examples/thermal.html#non-dimensional-transient-heat-conduction-on-a-cylinder
[Non-dimensional transient heat conduction with time-dependent properties]:
https://seamplex.com/feenox/examples/thermal.html#non-dimensional-transient-heat-conduction-with-time-dependent-properties
[NAFEMS LE10 “Thick plate pressure” benchmark]: https://seamplex.com/feenox/examples/mechanical.html#nafems-le10-thick-plate-pressure-benchmark
[NAFEMS LE11 “Solid Cylinder/Taper/Sphere-Temperature” benchmark]: https://seamplex.com/feenox/examples/mechanical.html#nafems-le11-solid-cylindertapersphere-temperature-benchmark
[NAFEMS LE1 “Elliptical membrane” plane-stress benchmark]: https://seamplex.com/feenox/examples/mechanical.html#nafems-le1-elliptical-membrane-plane-stress-benchmark
[Parametric study on a cantilevered beam]: https://seamplex.com/feenox/examples/mechanical.html#parametric-study-on-a-cantilevered-beam
[Parallelepiped whose Young’s modulus is a function of the temperature]:
https://seamplex.com/feenox/examples/mechanical.html#parallelepiped-whose-youngs-modulus-is-a-function-of-the-temperature
[Thermal problem]: https://seamplex.com/feenox/examples/mechanical.html#thermal-problem
[Mechanical problem]: https://seamplex.com/feenox/examples/mechanical.html#mechanical-problem
[Orthotropic free expansion of a cube]: https://seamplex.com/feenox/examples/mechanical.html#orthotropic-free-expansion-of-a-cube
[Thermo-elastic expansion of finite cylinders]: https://seamplex.com/feenox/examples/mechanical.html#thermo-elastic-expansion-of-finite-cylinders
[Temperature-dependent material properties]: https://seamplex.com/feenox/examples/mechanical.html#temperature-dependent-material-properties
[Two cubes compressing each other]: https://seamplex.com/feenox/examples/mechanical.html#two-cubes-compressing-each-other
[Optimizing the length of a tuning fork]: https://seamplex.com/feenox/examples/modal.html#optimizing-the-length-of-a-tuning-fork
[Five natural modes of a cantilevered wire]: https://seamplex.com/feenox/examples/modal.html#five-natural-modes-of-a-cantilevered-wire
[IAEA 2D PWR Benchmark]: https://seamplex.com/feenox/examples/neutron_diffusion.html#iaea-2d-pwr-benchmark
[IAEA 3D PWR Benchmark]: https://seamplex.com/feenox/examples/neutron_diffusion.html#iaea-3d-pwr-benchmark
[Cube-spherical bare reactor]: https://seamplex.com/feenox/examples/neutron_diffusion.html#cube-spherical-bare-reactor
[Illustration of the XS dilution & smearing effect]: https://seamplex.com/feenox/examples/neutron_diffusion.html#illustration-of-the-xs-dilution-smearing-effect
[Reed’s problem]: https://seamplex.com/feenox/examples/neutron_sn.html#reeds-problem
[Azmy’s problem]: https://seamplex.com/feenox/examples/neutron_sn.html#azmys-problem
[Second-order complete structured rectangular grid]: https://seamplex.com/feenox/examples/neutron_sn.html#second-order-complete-structured-rectangular-grid
[Fist-order locally-refined unstructured triangular grid]: https://seamplex.com/feenox/examples/neutron_sn.html#fist-order-locally-refined-unstructured-triangular-grid
[Flux profiles with ray effect]: https://seamplex.com/feenox/examples/neutron_sn.html#flux-profiles-with-ray-effect
Tutorials
See https://www.seamplex.com/feenox/doc/tutorials for updated
information.
1. Setting up your workspace
[Setting up your workspace]: https://www.seamplex.com/feenox/doc/tutorials/000-setup
General tutorials
1. Overview: the tensile test case
2. Fun & games: solving mazes with PDES instead of AI
[Overview: the tensile test case]: https://www.seamplex.com/feenox/doc/tutorials/110-tensile-test
[Fun & games: solving mazes with PDES instead of AI]: https://www.seamplex.com/feenox/doc/tutorials/120-mazes
Detailed functionality
1. Input files, expressions and command-line arguments
2. Static & transient cases
3. Functions & functionals
4. Vectors & matrices
5. Differential-algebraic equations
6. Meshes & distributions
Physics tutorials
1. The Laplace equation
2. Heat conduction
3. Linear elasticity
4. Modal analysis
5. Thermo-mechanical analysis
6. Neutron diffusion
7. Neutron transport
[Heat conduction]: https://www.seamplex.com/feenox/doc/tutorials/320-thermal
Description
FeenoX solves a problem defined in an plain-text input file and writes
user-defined outputs to the standard output and/or files, either also
plain-text or with a particular format for further post-processing. The
syntax of this input file is designed to be as self-describing as
possible, using English keywords that explains FeenoX what problem it
has to solve in a way is understandable by both humans and computers.
Keywords can work either as
1. Definitions, for instance ”define function f(x) and read its data
from file f.dat”), or as
2. Instructions, such as “write the stress at point D into the standard
output”.
A person can tell if a keyword is a definition or an instruction because
the former are nouns (FUNCTION) and the latter verbs (PRINT). The equal
sign = is a special keyword that is neither a verb nor a noun, and its
meaning changes depending on what is on the left hand side of the
assignment.
a. If there is a function, then it is a definition: define an algebraic
function to be equal to the expression on the right-hand side, e.g.:
f(x,y) = exp(-x^2)*cos(pi*y)
b. If there is a variable, vector or matrix, it is an instruction:
evaluate the expression on the right-hand side and assign it to the
variable or vector (or matrix) element indicated in the left-hand
side. Strictly speaking, if the variable has not already been
defined (and implicit declaration is allowed), then the variable is
also defined as well, e.g:
VAR a
VECTOR b[3]
a = sqrt(2)
b[i] = a*i^2
There is no need to explicitly define the scalar variable a with VAR
since the first assignment also defines it implicitly (if this is
allowed by the keyword IMPLICIT).
An input file can define its own variables as needed, such as my_var or
flag. But there are some reserved names that are special in the sense
that they either
1. can be set to modify the behavior of FeenoX, such as max_dt or
dae_tol
2. can be read to get the internal status or results back from FeenoX,
such as nodes or keff
3. can be either set or read, such as dt or done
The problem being solved can be static or transient, depending on
whether the special variable end_time is zero (default) or not. If it is
zero and static_steps is equal to one (default), the instructions in the
input file are executed once and then FeenoX quits. For example
VAR x
PRINT %.7f func_min(cos(x)+1,x,0,6)
If static_steps is larger than one, the special variable step_static is
increased and they are repeated the number of time indicated by
static_steps:
static_steps = 10
f(n) = n^2 - n + 41
PRINT f(step_static^2-1)
If the special variable end_time is set to a non-zero value, after
computing the static part a transient problem is solved. There are three
kinds of transient problems:
1. Plain “standalone” transients
2. Differential-Algebraic equations (DAE) transients
3. Partial Differential equations (PDE) transients
In the first case, after all the instruction in the input file were
executed, the special variable t is increased by the value of dt and
then the instructions are executed all over again, until t reaches
end_time:
end_time = 2*pi
dt = 1/10
y = lag(heaviside(t-1), 1)
z = random_gauss(0, sqrt(2)/10)
PRINT t sin(t) cos(t) y z HEADER
In the second case, the keyword PHASE_SPACE sets up DAE system. Then,
one initial condition and one differential-algebraic equation has to be
given for each element in the phase space. The instructions before the
DAE block executed, then the DAE timestep is advanced and finally the
instructions after DAE block are executed (there cannot be any
instruction between the first and the last DAE):
PHASE_SPACE x
end_time = 1
x_0 = 1
x_dot = -x
PRINT t x exp(-t) HEADER
The timestep is chosen by the SUNDIALS library in order to keep an
estimate of the residual error below dae_tol (default is 10⁻⁶), although
min_dt and max_dt can be used to control it. See the section of the
[Differential-Algebraic Equations subsystem] for more information.
In the third cae, the type of PDE being solved is given by the keyword
PROBLEM. Some types of PDEs do support transient problems (such as
thermal) but some others do not (such as modal). See the detailed
explanation of each problem type for details. Now the transient problem
is handled by the TS framework of the PETSc library. In general
transient PDEs involve a mesh, material properties, initial conditions,
transient boundary conditions, etc. And they create a lot of data since
results mean spatial and temporal distributions of one or more scalar
fields:
# example of a 1D heat transient problem
# from https://www.mcs.anl.gov/petsc/petsc-current/src/ts/tutorials/ex3.c.html
# a non-dimensional slab 0 < x < 1 is kept at T(0) = T(1) = 0
# there is an initial non-trivial T(x)
# the steady-state is T(x) = 0
PROBLEM thermal 1d
READ_MESH slab60.msh
end_time = 1e-1
# initial condition
T_0(x) := sin(6*pi*x) + 3*sin(2*pi*x)
# analytical solution
T_a(x,t) := exp(-36*pi^2*t)*sin(6*pi*x) + 3*exp(-4*pi^2*t)*sin(2*pi*x)
# unitary non-dimensional properties
k = 1
rho = 1
cp = 1
# boundary conditions
BC left T=0
BC right T=0
SOLVE_PROBLEM
PRINT %e t dt T(0.1) T_a(0.1,t) T(0.7) T_a(0.7,t)
WRITE_MESH temp-slab.msh T
IF done
PRINT "\# open temp-anim-slab.geo in Gmsh to see the result!"
ENDIF
PETSc’s TS also honors the min_dt and max_dt variables, but the time
step is controlled by the allowed relative error with the special
variable ts_rtol. Again, see the section of the [Partial Differential
Equations subsystem] for more information.
Algebraic expressions
To be done.
- Everything is an expression.
Initial conditions
Expansions of command line arguments
Reference
This chapter contains a detailed reference of keywords, variables,
functions and functionals available in FeenoX. These are used
essentially to define the problem that FeenoX needs to solve and to
define what the output should be. It should be noted that this chapter
is to be used, indeed, as a reference and not as a tutorial.
Differential-Algebraic Equations subsystem
DAE keywords
INITIAL_CONDITIONS
Define how initial conditions of DAE problems are computed.
INITIAL_CONDITIONS { AS_PROVIDED | FROM_VARIABLES | FROM_DERIVATIVES }
In DAE problems, initial conditions may be either:
- equal to the provided expressions (AS_PROVIDED)
- the derivatives computed from the provided phase-space variables
(FROM_VARIABLES)
- the phase-space variables computed from the provided derivatives
(FROM_DERIVATIVES)
In the first case, it is up to the user to fulfill the DAE system
at t = 0. If the residuals are not small enough, a convergence error
will occur. The FROM_VARIABLES option means calling IDA’s IDACalcIC
routine with the parameter IDA_YA_YDP_INIT. The FROM_DERIVATIVES option
means calling IDA’s IDACalcIC routine with the parameter IDA_Y_INIT.
Wasora should be able to automatically detect which variables in
phase-space are differential and which are purely algebraic. However,
the DIFFERENTIAL keyword may be used to explicitly define them. See the
SUNDIALS documentation for further information.
[SUNDIALS documentation]: https://computation.llnl.gov/casc/sundials/documentation/ida_guide.pdf
PHASE_SPACE
Ask FeenoX to solve a set of algebraic-differntial equations and define
the variables, vectors and/or matrices that span the phase space.
PHASE_SPACE PHASE_SPACE ... ... ...
TIME_PATH
Force time-dependent problems to pass through specific instants of time.
TIME_PATH [ [ ... ] ]
The time step dt will be reduced whenever the distance between the
current time t and the next expression in the list is greater than dt so
as to force t to coincide with the expressions given. The list of
expressions should evaluate to a sorted list of values for all times.
DAE variables
dae_rtol
Maximum allowed relative error for the solution of DAE systems.
Default value is is 1 × 10⁻⁶. If a fine per-variable error control is
needed, special vector abs_error should be used.
Partial Differential Equations subsystem
PDE keywords
BC
Define a boundary condition to be applied to faces, edges and/or
vertices.
BC [ MESH ] [ GROUP GROUP ... ] [ ... ] [ GROUPS ... ]
If the name of the boundary condition matches a physical group in the
mesh, and neither GROUP nor GROUPS are given, it is automatically linked
to that physical group. If there are many meshes, the mesh this keyword
refers to has to be given with MESH. If the boundary condition applies
to more than one physical group in the mesh, they can be added using as
many GROUP keywords as needed. Each argument is a single
string whose meaning depends on the type of problem being solved. For
instance T=150*sin(x/pi) prescribes the temperature to depend on space
as the provided expression in a thermal problem and fixed fixes the
displacements in all the directions in a mechanical or modal problem.
See the particular section on boundary conditions for further details.
If the keyword GROUPS is given, then the rest of the tokens are parsed
as group names where the boundary condition is applied. If either GROUP
or GROUPS are given explicitly, then the BC name is not used to try to
implicitly link it to a physical group in the mesh.
COMPUTE_REACTION
Compute the reaction (force, moment, power, etc.) at selected face, edge
or vertex.
COMPUTE_REACTION [ MOMENT [ X0 ] [ Y0 ] [ Z0 ] ] RESULT { | }
If the MOMENT keyword is not given, the zero-th order reaction is
computed, i.e. force in elasticity and power in thermal. If the MOMENT
keyword is given, then the coordinates of the center can be given with
X0, Y0 and Z0. If they are not, the moment is computed about the
barycenter of the physical group. The resulting reaction will be stored
in the variable (thermal) or vector (elasticity) provided. If the
variable or vector does not exist, it will be created.
DUMP
Dump raw PETSc objects used to solve PDEs into files.
DUMP [ FORMAT { binary | ascii | octave } ] [ K | K_bc | b | b_bc | M | M_bc |
FIND_EXTREMA
Find and/or compute the absolute extrema of a function or expression
over a mesh (or a subset of it).
FIND_EXTREMA { | } [ OVER ] [ MESH ] [ NODES | CELLS | GAUSS ]
[ MIN ] [ MAX ] [ X_MIN ] [ X_MAX ] [ Y_MIN ] [ Y_MAX ] [ Z_MIN ] [ Z_MAX ] [ I_MIN ] [ I_MAX ]
Either an expression or a function of space x, y and/or z should be
given. By default the search is performed over the highest-dimensional
elements of the mesh, i.e. over the whole volume, area or length for
three, two and one-dimensional meshes, respectively. If the search is to
be carried out over just a physical group, it has to be given in OVER.
If there are more than one mesh defined, an explicit one has to be given
with MESH. If neither NODES, CELLS or GAUSS is given then the search is
performed over the three of them. With NODES only the function or
expression is evalauted at the mesh nodes. With CELLS only the function
or expression is evalauted at the element centers. With GAUSS only the
function or expression is evalauted at the Gauss points. The value of
the absolute minimum (maximum) is stored in the variable indicated by
MIN (MAX). If the variable does not exist, it is created. The value of
the x-y-z coordinate of the absolute minimum (maximum) is stored in the
variable indicated by X_MIN-Y_MIN-Z_MIN (X_MAX-Y_MAX-Z_MAX). If the
variable does not exist, it is created. The index (either node or cell)
where the absolute minimum (maximum) is found is stored in the variable
indicated by I_MIN (I_MAX).
INTEGRATE
Spatially integrate a function or expression over a mesh (or a subset of
it).
INTEGRATE { | } [ OVER ] [ MESH ] [ GAUSS | CELLS ]
RESULT
Either an expression or a function of space x, y and/or z should be
given. If the integrand is a function, do not include the arguments,
i.e. instead of f(x,y,z) just write f. The results should be the same
but efficiency will be different (faster for pure functions). By default
the integration is performed over the highest-dimensional elements of
the mesh, i.e. over the whole volume, area or length for three, two and
one-dimensional meshes, respectively. If the integration is to be
carried out over just a physical group, it has to be given in OVER. If
there are more than one mesh defined, an explicit one has to be given
with MESH. Either GAUSS or CELLS define how the integration is to be
performed. With GAUSS the integration is performed using the Gauss
points and weights associated to each element type. With CELLS the
integral is computed as the sum of the product of the integrand at the
center of each cell (element) and the cell’s volume. Do expect
differences in the results and efficiency between these two approaches
depending on the nature of the integrand. The scalar result of the
integration is stored in the variable given by the mandatory keyword
RESULT. If the variable does not exist, it is created.
MATERIAL
Define a material its and properties to be used in volumes.
MATERIAL [ MESH ] [ LABEL [ LABEL [ ... ] ] ]
[ = [ = [ ... ] ] ]
If the name of the material matches a physical group in the mesh, it is
automatically linked to that physical group. If there are many meshes,
the mesh this keyword refers to has to be given with MESH. If the
material applies to more than one physical group in the mesh, they can
be added using as many LABEL keywords as needed. The names of the
properties in principle can be arbitrary, but each problem type needs a
minimum set of properties defined with particular names. For example,
steady-state thermal problems need at least the conductivity which
should be named k. If the problem is transient, it will also need heat
capacity rhocp or diffusivity alpha. Mechanical problems need Young
modulus E and Poisson’s ratio nu. Modal also needs density rho. Check
the particular documentation for each problem type. Besides these
mandatory properties, any other one can be defined. For instance, if one
mandatory property depended on the concentration of boron in the
material, a new per-material property can be added named boron and then
the function boron(x,y,z) can be used in the expression that defines the
mandatory property.
PETSC_OPTIONS
Pass verbatim options to PETSc.
PETSC_OPTIONS "command-line options for PETSc"
Options for PETSc can be passed either in at run time in the command
line (run with -h to see how) or they can be set in the input file with
PETSC_OPTIONS. This is handy when a particular problem is best suited to
be solved using a particular set of options which can the be embedded
into the problem definition. @
The string is passed verbatim to PETSc as if the options were set in the
command line. Note that in this case, the string is passed verbatim to
PETSc. This means that they are non-POSIX options but they have to be in
the native PETSc format. That is to say, while in the command line one
would give --ksp_view, here one has to give -ksp_view. Conversely,
instead of --mg_levels_pc_type=sor one has to give
-mg_levels_pc_type sor.
PHYSICAL_GROUP
Explicitly defines a physical group of elements on a mesh.
PHYSICAL_GROUP [ MESH ] [ DIMENSION ] [ ID ]
[ MATERIAL | | BC [ BC ... ] ]
This keyword should seldom be needed. Most of the times, a combination
of MATERIAL and BC ought to be enough for most purposes. The name of the
PHYSICAL_GROUP keyword should match the name of the physical group
defined within the input file. If there is no physical group with the
provided name in the mesh, this instruction has no effect. If there are
many meshes, an explicit mesh can be given with MESH. Otherwise, the
physical group is defined on the main mesh. An explicit dimension of the
physical group can be provided with DIMENSION. An explicit id can be
given with ID. Both dimension and id should match the values in the
mesh. For volumetric elements, physical groups can be linked to
materials using MATERIAL. Note that if a material is created with the
same name as a physical group in the mesh, they will be linked
automatically, so there is no need to use PHYSCAL_GROUP for this. The
MATERIAL keyword in PHYSICAL_GROUP is used to link a physical group in a
mesh file and a material in the feenox input file with different names.
Likewise, for non-volumetric elements, physical groups can be linked to
boundary using BC. As in the preceding case, if a boundary condition is
created with the same name as a physical group in the mesh, they will be
linked automatically, so there is no need to use PHYSCAL_GROUP for this.
The BC keyword in PHYSICAL_GROUP is used to link a physical group in a
mesh file and a boundary condition in the feenox input file with
different names. Note that while there can be only one MATERIAL
associated to a physical group, there can be many BCs associated to a
physical group.
PROBLEM
Ask FeenoX to solve a partial differential equation problem.
PROBLEM { laplace | mechanical | modal | neutron_diffusion | neutron_sn | thermal }
[ 1D | 2D | 3D | DIM ] [ AXISYMMETRIC { x | y } ]
[ MESH ] [ PROGRESS ] [ DO_NOT_DETECT_HANGING_NODES | DETECT_HANGING_NODES | HANDLE_HANGING_NODES ]
[ DETECT_UNRESOLVED_BCS | ALLOW_UNRESOLVED_BCS ]
[ PREALLOCATE ] [ ALLOW_NEW_NONZEROS ] [ CACHE_J ] [ CACHE_B ]
[ TRANSIENT | QUASISTATIC ] [ LINEAR | NON_LINEAR ]
[ MODES ]
[ PRECONDITIONER { gamg | mumps | lu | hypre | sor | bjacobi | cholesky | ... } ]
[ LINEAR_SOLVER { gmres | mumps | bcgs | bicg | richardson | chebyshev | ... } ]
[ NONLINEAR_SOLVER { newtonls | newtontr | nrichardson | ngmres | qn | ngs | ... } ]
[ TRANSIENT_SOLVER { bdf | beuler | arkimex | rosw | glee | ... } ]
[ TIME_ADAPTATION { basic | none | dsp | cfl | glee | ... } ]
[ EIGEN_SOLVER { krylovschur | lanczos | arnoldi | power | gd | ... } ]
[ SPECTRAL_TRANSFORMATION { shift | sinvert | cayley | ... } ]
[ EIGEN_FORMULATION { omega | lambda } ]
[ DIRICHLET_SCALING { absolute | relative } ]
Currently, FeenoX can solve the following types of PDE-casted problems:
- neutron_diffusion multi-group core-level neutron diffusion with a
FEM formulation
- neutron_sn multi-group core-level neutron transport using
- discrete ordinates S_(N) for angular discretization, and
- isoparametric finite elements for spatial discretization.
If you are a programmer and want to contribute with another problem
type, please do so! Check out the programming guide in the FeenoX
repository.
The number of spatial dimensions of the problem needs to be given either
as 1d, 2d, 3d or after the keyword DIM. Alternatively, one can define a
MESH with an explicit DIMENSIONS keyword before PROBLEM. Default is 3D.
If the AXISYMMETRIC keyword is given, the mesh is expected to be
two-dimensional in the x-y plane and the problem is assumed to be
axi-symmetric around the given axis. If there are more than one MESHes
defined, the one over which the problem is to be solved can be defined
by giving the explicit mesh name with MESH. By default, the first mesh
to be defined in the input file with READ_MESH (which can be defined
after the PROBLEM keyword) is the one over which the problem is solved.
If the keyword PROGRESS is given, three ASCII lines will show in the
terminal the progress of the ensamble of the stiffness matrix (or
matrices), the solution of the system of equations and the computation
of gradients (stresses, heat fluxes, etc.), if applicable. If either
DETECT_HANGING_NODES or HANDLE_HANGING_NODES are given, an intermediate
check for nodes without any associated elements will be performed. For
well-behaved meshes this check is redundant so by default it is not done
(DO_NOT_DETEC_HANGING_NODES). With DETECT_HANGING_NODES, FeenoX will
report the tag of the hanging nodes and stop. With HANDLE_HANGING_NODES,
FeenoX will fix those nodes and try to solve the problem anyway. By
default, FeenoX checks that all physical groups referred to in the BC
keywords exists (DETECT_UNRESOLVED_BCS). If ALLOW_UNRESOLVED_BCS is
given, FeenoX will ignore unresolved boundary conditions instead of
complaining. This is handy when using the same input for different
meshes which might have different groups, for example solving the same
problem using a full geometry or a symmetric geometry. The latter should
have at least one symmetry BC whilst the former does not. If the special
variable end_time is zero, FeenoX solves a static problem—although the
variable static_steps is still honored. If end_time is non-zero, FeenoX
solves a transient or quasi-static problem. This can be controlled by
TRANSIENT or QUASISTATIC. By default FeenoX tries to detect whether the
computation should be linear or non-linear. An explicit mode can be set
with either LINEAR on NON_LINEAR. The number of modes to be computed
when solving eigenvalue problems is given by MODES. The default value is
problem dependent. The preconditioner (PC), linear (KSP), non-linear
(SNES) and time-stepper (TS) solver types be any of those available in
PETSc (first option is the default):
- List of PRECONDITIONERs
https://petsc.org/release/manualpages/PC/PCType/.
- List of LINEAR_SOLVERs
https://petsc.org/release/manualpages/KSP/KSPType/.
- List of NONLINEAR_SOLVERs
https://petsc.org/release/manualpages/SNES/SNESType/.
- List of TRANSIENT_SOLVERs
http://petsc.org/release/docs/manualpages/TS/TSType.html.
- List of TIME_ADAPTATIONs
https://petsc.org/release/manualpages/TS/TSType/.
- List of EIGEN_SOLVERs
https://slepc.upv.es/documentation/current/docs/manualpages/EPS/EPSType.html.
- List of SPECTRAL_TRANSFORMATIONs
https://slepc.upv.es/documentation/current/docs/manualpages/ST/STType.html.
If the EIGEN_FORMULATION is omega then Kϕ = ω²Mϕ is solved, and Mϕ = λKϕ
if it is lambda. Default is lambda, although some particular PDEs might
change it (for example free-free modal switches to omega). The
EIGEN_DIRICHLET_ZERO keyword controls which of the matrices has a zero
and which one has a non-zero in the diagonal when setting Dirichlet
boundary conditions. Default is M, i.e. matrix K has a non-zero and
matrix M has a zero. This setting, along with EIGEN_FORMULATION
determines which spectral transforms can a cannot be used: you cannot
invert the matrix with the zero in the diagonal. The DIRICHLET_SCALING
keyword controls the way Dirichlet boundary conditions are scaled when
computing the residual. Roughly, it defines how to compute the
parameter α.[1] If absolute, then α is equal to the given expression. If
relative, then α is equal to the given fraction of the average diagonal
entries in the stiffness matrix. Default is α = 1.
[1] https://scicomp.stackexchange.com/questions/3298/appropriate-space-for-weak-solutions-to-an-elliptical-pde-with-mixed-inhomogeneo/3300#3300
[programming guide in the FeenoX repository]: https://github.com/seamplex/feenox/blob/main/doc/programming.md
READ_MESH
Read an unstructured mesh and (optionally) functions of space-time from
a file.
READ_MESH { | } [ DIM ]
[ SCALE ] [ OFFSET ]
[ INTEGRATION { full | reduced } ]
[ MAIN ] [ UPDATE_EACH_STEP ]
[ READ_FIELD AS ] [ READ_FIELD ... ]
[ READ_FUNCTION ] [READ_FUNCTION ...]
Either a file identifier (defined previously with a FILE keyword) or a
file path should be given. The format is read from the extension, which
should be either
- .msh, .msh2 or .msh4 Gmsh ASCII format, versions 2.2, 4.0 or 4.1
- .vtk ASCII legacy VTK
- .frd CalculiX’s FRD ASCII output
Note than only MSH is suitable for defining PDE domains, as it is the
only one that provides physical groups (a.k.a labels) which are needed
in order to define materials and boundary conditions. The other formats
are primarily supported to read function data contained in the file and
eventually, to operate over these functions (i.e. take differences with
other functions contained in other files to compare results). The file
path or file id can be used to refer to a particular mesh when reading
more than one, for instance in a WRITE_MESH or INTEGRATE keyword. If a
file path is given such as cool_mesh.msh, it can be later referred to as
either cool_mesh.msh or just cool_mesh.
The spatial dimensions can be given with DIM. If material properties are
uniform and given with variables, the number of dimensions are not
needed and will be read from the file at runtime. But if either
properties are given by spatial functions or if functions are to be read
from the mesh with READ_DATA or READ_FUNCTION, then the number of
dimensions ought to be given explicitly because FeenoX needs to know how
many arguments these functions take. If either OFFSET and/or SCALE are
given, the node locations are first shifted and then scaled by the
provided values. When defining several meshes and solving a PDE problem,
the mesh used as the PDE domain is the one marked with MAIN. If none of
the meshes is explicitly marked as main, the first one is used. If
UPDATE_EACH_STEP is given, then the mesh data is re-read from the file
at each time step. Default is to read the mesh once, except if the file
path changes with time. For each READ_FIELD keyword, a point-wise
defined scalar function of space named is defined and
filled with the scalar data named contained in the mesh
file. The READ_FUNCTION keyword is a shortcut when the scalar name and
the to-be-defined function are the same. If no mesh is marked as MAIN,
the first one is the main one.
[Gmsh ASCII format]: http://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format
[ASCII legacy VTK]: https://lorensen.github.io/VTKExamples/site/VTKFileFormats/
[CalculiX’s FRD ASCII output]: https://web.mit.edu/calculix_v2.7/CalculiX/cgx_2.7/doc/cgx/node4.html
SOLVE_PROBLEM
Explicitly solve the PDE problem.
SOLVE_PROBLEM
Whenever the instruction SOLVE_PROBLEM is executed, FeenoX solves the
PDE problem. For static problems, that means solving the equations and
filling in the result functions. For transient or quasisstatic problems,
that means advancing one time step.
WRITE_MESH
Write a mesh and/or generic functions of space-time to a post-processing
file.
WRITE_MESH [ MESH ] [ FILE_FORMAT { gmsh | vtk } ] [ NO_MESH ] [ NO_PHYSICAL_NAMES ]
[ NODE | CELL ] [ ]
[ ] [ ] [...]
[ VECTOR [ NAME ] ] [...]
[ SYMMETRIC_TENSOR [ NAME ] ] [...]
The format is automatically detected from the extension, which should be
either msh (version 2.2 ASCII) or vtk (legacy ASCII). Otherwise, the
keyword FILE_FORMAT has to be given to set the format explicitly. If
there are several meshes defined by READ_MESH, the mesh used to write
the data has be given explicitly with MESH. If the NO_MESH keyword is
given, only the results are written into the output file without any
mesh data. Depending on the output format, this can be used to avoid
repeating data and/or creating partial output files which can the be
latter assembled by post-processing scripts. When targeting the .msh
output format, if NO_PHYSICAL_NAMES is given then the section that sets
the actual names of the physical entities is not written.
This might be needed in some cases to avoid name clashes when dealing
with multiple .msh files. The output is node-based by default. This can
be controlled with both the NODE and CELL keywords. All fields that come
after a NODE (CELL) keyword will be written at the node (cells). These
keywords can be used several times and mixed with fields. For example
CELL k(x,y,z) NODE T sqrt(x^2+y^2) CELL 1+z will write the conductivity
and the expression 1 + z as cell-based and the temperature T(x, y, z)
and the expression $\sqrt{x^2+y^2}$ as a node-based fields. If a
printf-like format specifier starting with % is given, that format is
used for the fields that follow. Make sure the format reads
floating-point data, i.e. do not use %d. Default is %g. The data to be
written has to be given as a list of fields, i.e. distributions (such as
k or E), functions of space (such as T) and/or expressions (such as
T(x,y,z)*sqrt(x^2+y^2+z^2)). Each field is written as a scalar, unless
either the keywords VECTOR or SYMMETRIC_TENSOR are given. In the first
case, the next three fields following the VECTOR keyword are taken as
the vector elements. In the latter, the next six fields following the
SYMMETRIC_TENSOR keyword are taken as the tensor elements.
WRITE_RESULTS
Write the problem mesh and problem results to a file for
post-processing.
WRITE_RESULTS [ FORMAT { gmsh | vtu | vtk } ] [ FILE ]
[ NO_PHYSICAL_NAMES ] [ ]
Default format is gmsh. If no FILE is provided, the output file is the
same as the input file replacing the .fee extension with the format
extension, i.e. $0.msh. If there are further optional command line
arguments, they are added prepending a dash, i.e. $0-[$1-[$2...]].msh
Otherwise the given FILE is used. If no explicit FORMAT is given, the
format is read from the FILE extension. When targeting the .msh output
format, if NO_PHYSICAL_NAMES is given then the section that sets the
actual names of the physical entities is not written.
This might be needed in some cases to avoid name clashes when dealing
with multiple .msh files. If a printf-like format specifier starting
with % is given, that format is used for the fields that follow. Make
sure the format reads floating-point data, i.e. do not use %d. Default
is %g.
PDE variables
Laplace’s equation
Set PROBLEM to laplace to solve Laplace’s equation
∇²ϕ = 0
If end_time is set, then the transient problem is solved
$$
\alpha(\vec{x}) \frac{\partial \phi}{\partial t} + \nabla^2 \phi = 0
$$
Laplace results
phi
The scalar field ϕ(x⃗) whose Laplacian is equal to zero or to f(x⃗).
Laplace properties
alpha
The coefficient of the temporal derivative for the transient equation
$\alpha \frac{\partial \phi}{\partial t} + \nabla^2 \phi=f(\vec{x})$.
If not given, default is one.
f
The right hand side of the equation ∇²ϕ = f(x⃗). If not given, default is
zero (i.e. Laplace).
Laplace boundary conditions
dphidn
Alias for phi'.
dphidn=
phi
Dirichlet essential boundary condition in which the value of ϕ is
prescribed.
phi=
phi'
Neumann natural boundary condition in which the value of the normal
outward derivative $\frac{\partial \phi}{\partial n}$ is prescribed.
phi'=
Laplace keywords
Laplace variables
The heat conduction equation
Set PROBLEM to thermal to solve the heat conduction equation:
$$
\rho(\vec{x},T) c_p(\vec{x},T) \cdot \frac{\partial T}{\partial t} + \text{div} \left[ k(\vec{x}, T) \cdot \text{grad}{T} \right] = q'''(\vec{x}, T)
$$
- If end_time is zero, only the steady-state problem is solved.
- If end_time > zero, then a transient problem is solved.
- If either
a. k, and/or
b. `q’’’$, and/or
c. any Neumann boundary condition
depends on T, the problem is set to non-linear automatically.
Check out the heat conduction tutorial as well.
[6]: #problem
[end_time]: #end_time
[k]: #k
[`q’’’]: #q-1
[T]: #t
[heat conduction tutorial]: https://www.seamplex.com/feenox/doc/tutorials/320-thermal/
Thermal results
qx
The heat flux
field $q_x(\vec{x}) = -k(\vec{x}) \cdot \frac{\partial T}{\partial x}$
in the x direction. This is a secondary unknown of the problem.
qy
The heat flux
field $q_y(\vec{x}) = -k(\vec{x}) \cdot \frac{\partial T}{\partial y}$
in the x direction. This is a secondary unknown of the problem. Only
available for two and three-dimensional problems.
qz
The heat flux
field $q_z(\vec{x}) = -k(\vec{x}) \cdot \frac{\partial T}{\partial z}$
in the x direction. This is a secondary unknown of the problem.
Only available for three-dimensional problems.
T
The temperature field T(x⃗). This is the primary unknown of the problem.
Thermal properties
cp
Specific heat in units of energy per unit of mass per degree of
temperature. Either kappa, rhocp or both rho and cp are needed for
transient
cp
k
The thermal conductivity in units of power per length per degree of
temperature. This property is mandatory.
k
kappa
Thermal diffusivity in units of area per unit of time. Equal to
k/(ρc_(p)), the thermal conductivity k divided by the density rho and
specific heat capacity cp. Either kappa, rhocp or both rho and cp are
needed for transient
kappa
q
Alias for q'''
q
q'''
The volumetric power dissipated in the material in units of power per
unit of volume. Default is zero (i.e. no power).
q'''
rho
Density in units of mass per unit of volume. Either kappa, rhocp or both
rho and cp are needed for transient
rho
rhocp
Product of the density rho times the specific heat capacity cp, in units
of energy per unit of volume per degree of temperature. Either kappa,
rhocp or both rho and cp are needed for transient
rhocp
T_0
The initial condition for the temperature in transient problems. If not
given, a steady-steady computation at t = 0 is performed.
T_guess
The initial guess for the temperature in steady-state problems. If not
given, a uniform distribution equal to the the average of all the
temperature appearing in boundary conditions is used.
Thermal boundary conditions
Thermal keywords
Thermal variables
T_max
The maximum temperature T_(max).
T_min
The minimum temperature T_(min).
Linear elasticity
Set PROBLEM to mechanical to solve linear elasticity.
Check out the tensile test tutorial as well.
[PROBLEM6]: #problem
[tensile test tutorial]: https://www.seamplex.com/feenox/doc/tutorials/110-tensile-test/
Elasticity results
Elasticity properties
Elasticity boundary conditions
Elasticity keywords
LINEARIZE_STRESS
Compute linearized membrane and/or bending stresses according to
ASME VIII Div 2 Sec 5.
LINEARIZE_STRESS FROM TO
[ M ] [ MB ] [ P ]
[ Mt ] [ MBt ] [ Pt ]
[ M1 ] [ MB1 ] [ P1 ]
[ M2 ] [ MB2 ] [ P2 ]
[ M3 ] [ MB3 ] [ P3 ]
[ FILE ]
The stress classification line (SCL) defined by the coordinates of the
points [x₁, y₁, z₁] and [x₂, y₂, z₂]. For two-dimensional problems, the
z coordinate has to be given as well. The linearized membrane, membrane
plus bending and peak total stresses are stored in the variables given
by the keywords M, MB and P, respectively. These three variables use the
von Mises stress intensity. Variables Mt, MBt and Pt use the Tresca
stress intensity. Variables M1 (or 2 or 3), MB1 (or 2 or 3) and P1 (or 2
or 3) use the principal stress 1 (or 2 or 3). If the FILE keyword is
given, the total, membrane and membrane plus bending
Elasticity variables
Neutron transport with discrete ordinates
Neutron transport results
Neutron transport properties
Neutron transport boundary conditions
Neutron transport keywords
Neutron transport variables
chi
A vector of size groups with the fission spectrum. Default is one in the
first group and zero in the rest.
keff
The effective multiplication factor k_(eff).
sn_alpha
The stabilization parameter α for S_(N).
General & “standalone” mathematics
Keywords
ABORT
Catastrophically abort the execution and quit FeenoX.
ABORT
Whenever the instruction ABORT is executed, FeenoX quits with a non-zero
error leve. It does not close files nor unlock shared memory objects.
The objective of this instruction is to either debug complex input files
by using only parts of them or to conditionally abort the execution
using IF clauses.
ALIAS
Define a scalar alias of an already-defined identifier.
ALIAS { IS | AS }
The existing object can be a variable, a vector element or a matrix
element. In the first case, the name of the variable should be given as
the existing object. In the second case, to alias the second element of
vector v to the new name new, v(2) should be given as the existing
object. In the third case, to alias second element (2,3) of matrix M to
the new name new, M(2,3) should be given as the existing object.
CLOSE
Explicitly close a file after input/output.
CLOSE
The given can be either a fixed-string path or an already-defined
FILE.
DEFAULT_ARGUMENT_VALUE
Give a default value for an optional commandline argument.
DEFAULT_ARGUMENT_VALUE
If a $n construction is found in the input file but the commandline
argument was not given, the default behavior is to fail complaining that
an extra argument has to be given in the commandline. With this keyword,
a default value can be assigned if no argument is given, thus avoiding
the failure and making the argument optional. The should be
1, 2, 3, etc. and will be expanded character-by-character where
the $n construction is. Whether the resulting expression is to be
interpreted as a string or as a numerical expression will depend on the
context.
FILE
Define a file with a particularly formatted name to be used either as
input or as output.
< FILE | OUTPUT_FILE | INPUT_FILE > PATH expr_1 expr_2 ... expr_n [ INPUT | OUTPUT | APPEND | MODE ]
For reading or writing into files with a fixed path, this instruction is
usually not needed as the FILE keyword of other instructions (such as
PRINT or MESH) can take a fixed-string path as an argument. However, if
the file name changes as the execution progresses (say because one file
for each step is needed), then an explicit FILE needs to be defined with
this keyword and later referenced by the given name.
The path should be given as a printf-like format string followed by the
expressions which should be evaluated in order to obtain the actual file
path. The expressions will always be floating-point expressions, but the
particular integer specifier %d is allowed and internally transformed to
%.0f. The file can be explicitly defined and INPUT, OUTPUT or a certain
fopen() mode can be given (i.e. “a”). If not explicitly given, the
nature of the file will be taken from context, i.e. FILEs in PRINT will
be OUTPUT and FILEs in FUNCTION will be INPUT. This keyword just defines
the FILE, it does not open it. The file will be actually opened (and
eventually closed) automatically. In the rare case where the automated
opening and closing does not fit the expected workflow, the file can be
explicitly opened or closed with the instructions FILE_OPEN and
FILE_CLOSE.
FIT
Find parameters to fit an analytical function to a pointwise-defined
function.
FIT TO VIA ...
[ GRADIENT ... ]
[ RANGE_MIN ... ]
[ RANGE_MAX ... ]
[ TOL_REL ] [ TOL_ABS ] [ MAX_ITER ]
[ VERBOSE ]
The function with the data has to be point-wise defined (i.e. a FUNCTION
read from a file, with inline DATA or defined over a mesh). The function
to be fitted has to be parametrized with at least one of the variables
provided after the USING keyword. For example to
fit f(x, y) = ax² + bsqrt(y) to a pointwise-defined function g(x, y) one
gives FIT f TO g VIA a b. Only the names of the functions have to be
given, not the arguments. Both functions have to have the same number of
arguments. The initial guess of the solution is given by the initial
value of the variables after the VIA keyword. Analytical expressions for
the gradient of the function to be fitted with respect to the parameters
to be fitted can be optionally given with the GRADIENT keyword. If none
is provided, the gradient will be computed numerically using finite
differences. A range over which the residuals are to be minimized can be
given with RANGE_MIN and RANGE_MAX. The expressions give the range of
the arguments of the functions, not of the parameters. For
multidimensional fits, the range is an hypercube. If no range is given,
all the definition points of the function with the data are used for the
fit. Convergence can be controlled by giving the relative and absolute
tolreances with TOL_REL (default DEFAULT_NLIN_FIT_EPSREL) and TOL_ABS
(default DEFAULT_NLIN_FIT_EPSABS), and with the maximum number of
iterations MAX_ITER (default DEFAULT_NLIN_FIT_MAX_ITER). If the optional
keyword VERBOSE is given, some data of the intermediate steps is written
in the standard output.
FUNCTION
Define a scalar function of one or more variables.
FUNCTION ([,var2,...,var_n]) {
= |
FILE { } |
VECTORS ... |
MESH |
DATA ...
}
[ COLUMNS ... ]
[ INTERPOLATION { linear | polynomial | spline | spline_periodic | akima | akima_periodic | steffen |
nearest | shepard | shepard_kd | bilinear } ]
[ INTERPOLATION_THRESHOLD ] [ SHEPARD_RADIUS ] [ SHEPARD_EXPONENT ]
The number of variables n is given by the number of arguments given
between parenthesis after the function name. The arguments are defined
as new variables if they had not been already defined explicitly as
scalar variables. If the function is given as an algebraic expression,
the short-hand operator = (or := for compatibility with Maxima) can be
used. That is to say, FUNCTION f(x) = x^2 is equivalent to f(x) = x^2
(or f(x) := x^2). If a FILE is given, an ASCII file containing at least
n + 1 columns is expected. By default, the first n columns are the
values of the arguments and the last column is the value of the function
at those points. The order of the columns can be changed with the
keyword COLUMNS, which expects n + 1 expressions corresponding to the
column numbers. If VECTORS is given, a set of n + 1 vectors of the same
size is expected. The first n correspond to the arguments and the last
one to the function values. If MESH is given, the function is point-wise
defined over the mesh topology. That is to say, the independent
variables (i.e. the spatial coordinates) coincide with the mesh nodes.
The dependent variable (i.e. the function value) is set by “filling” a
vector named vec_f (where f has to be replaced with the function name)
of size equal to the number of nodes.
The function can be pointwise-defined inline in the input using DATA.
This should be the last keyword of the line, followed by N = k ⋅ (n + 1)
expressions giving k definition points: n arguments and the value of the
function. Multiline continuation using brackets { and } can be used for
a clean data organization. Interpolation schemes can be given for either
one or multi-dimensional functions with INTERPOLATION. Available schemes
for n = 1 are:
- linear
- polynomial, the grade is equal to the number of data minus one
- spline, cubic (needs at least 3 points)
- spline_periodic
- akima (needs at least 5 points)
- akima_periodic (needs at least 5 points)
- steffen, always-monotonic splines-like interpolator
Default interpolation scheme for one-dimensional functions is
DEFAULT_INTERPOLATION.
Available schemes for n > 1 are:
- nearest, f(x⃗) is equal to the value of the closest definition point
- shepard, inverse distance weighted average definition points (might
lead to inefficient evaluation)
- shepard_kd, average of definition points within a kd-tree (more
efficient evaluation provided SHEPARD_RADIUS is set to a proper
value)
- bilinear, only available if the definition points configure an
structured hypercube-like grid. If n > 3, SIZES should be given.
For n > 1, if the euclidean distance between the arguments and the
definition points is smaller than INTERPOLATION_THRESHOLD, the
definition point is returned and no interpolation is performed. Default
value is square root of DEFAULT_MULTIDIM_INTERPOLATION_THRESHOLD.
The initial radius of points to take into account in shepard_kd is given
by SHEPARD_RADIUS. If no points are found, the radius is double until at
least one definition point is found. The radius is doubled until at
least one point is found. Default is DEFAULT_SHEPARD_RADIUS. The
exponent of the shepard method is given by SHEPARD_EXPONENT. Default is
DEFAULT_SHEPARD_EXPONENT.
[inverse distance weighted average definition points]: https://en.wikipedia.org/wiki/Inverse_distance_weighting
[average of definition points within a kd-tree]: https://en.wikipedia.org/wiki/Inverse_distance_weighting#Modified_Shepard's_method
IF
Execute a set of instructions if a condition is met.
IF expr
[ ELSE
]
ENDIF
IMPLICIT
Define whether implicit definition of variables is allowed or not.
IMPLICIT { NONE | ALLOWED }
By default, FeenoX allows variables (but not vectors nor matrices) to be
implicitly declared. To avoid introducing errors due to typos, explicit
declaration of variables can be forced by giving IMPLICIT NONE. Whether
implicit declaration is allowed or explicit declaration is required
depends on the last IMPLICIT keyword given, which by default is ALLOWED.
INCLUDE
Include another FeenoX input file.
INCLUDE [ FROM ] [ TO ]
Includes the input file located in the string file_path at the current
location. The effect is the same as copying and pasting the contents of
the included file at the location of the INCLUDE keyword. The path can
be relative or absolute. Note, however, that when including files inside
IF blocks that instructions are conditionally-executed but all
definitions (such as function definitions) are processed at parse-time
independently from the evaluation of the conditional. The included file
has to be an actual file path (i.e. it cannot be a FeenoX FILE) because
it needs to be resolved at parse time. Yet, the name can contain a
commandline replacement argument such as $1 so INCLUDE $1.fee will
include the file specified after the main input file in the command
line. The optional FROM and TO keywords can be used to include only
portions of a file.
MATRIX
Define a matrix.
MATRIX ROWS COLS [ DATA ... |
A new matrix of the prescribed size is defined. The number of rows and
columns can be an expression which will be evaluated the very first time
the matrix is used and then kept at those constant values. All elements
will be initialized to zero unless DATA is given (which should be the
last keyword of the line), in which case the expressions will be
evaluated the very first time the matrix is used and row-major-assigned
to each of the elements. If there are less elements than the matrix
size, the remaining values will be zero. If there are more elements than
the matrix size, the values will be ignored.
OPEN
Explicitly open a file for input/output.
OPEN [ MODE ]
The given can be either a fixed-string path or an already-defined
FILE. The mode is only taken into account if the file is not already
defined. Default is write w.
PRINT
Write plain-text and/or formatted data to the standard output or into an
output file.
PRINT [ ... ] [ TEXT ... TEXT ]
[ FILE { | } ] [ HEADER ] [ NONEWLINE ] [ SEP ]
[ SKIP_STEP ] [ SKIP_STATIC_STEP ] [ SKIP_TIME ] [ SKIP_HEADER_STEP ]
Each argument object which is not a keyword of the PRINT instruction
will be part of the output. Objects can be either a matrix, a vector or
any valid scalar algebraic expression. If the given object cannot be
solved into a valid matrix, vector or expression, it is treated as a
string literal if IMPLICIT is ALLOWED, otherwise a parser error is
raised. To explicitly interpret an object as a literal string even if it
resolves to a valid numerical expression, it should be prefixed with the
TEXT keyword such as PRINT TEXT 1+1 that would print 1+1 instead of 2.
Objects and string literals can be mixed and given in any order. Hashes
# appearing literal in text strings have to be quoted to prevent the
parser to treat them as comments within the FeenoX input file and thus
ignoring the rest of the line, like
PRINT "\# this is a printed comment". Whenever an argument starts with a
porcentage sign %, it is treated as a C printf-compatible format
specifier and all the objects that follow it are printed using the given
format until a new format definition is found. The objects are treated
as double-precision floating point numbers, so only floating point
formats should be given. See the printf(3) man page for further details.
The default format is DEFAULT_PRINT_FORMAT. Matrices, vectors, scalar
expressions, format modifiers and string literals can be given in any
desired order, and are processed from left to right. Vectors are printed
element-by-element in a single row. See PRINT_VECTOR to print one or
more vectors with one element per line (i.e. vertically). Matrices are
printed element-by-element in a single line using row-major ordering if
mixed with other objects but in the natural row and column fashion if it
is the only given object in the PRINT instruction. If the FILE keyword
is not provided, default is to write to stdout. If the HEADER keyword is
given, a single line containing the literal text given for each object
is printed at the very first time the PRINT instruction is processed,
starting with a hash # character.
If the NONEWLINE keyword is not provided, default is to write a newline
\n character after all the objects are processed. Otherwise, if the last
token to be printed is a numerical value, a separator string will be
printed but not the newline \n character. If the last token is a string,
neither the separator nor the newline will be printed. The SEP keyword
expects a string used to separate printed objects. To print objects
without any separation in between give an empty string like SEP "". The
default is a tabulator character ‘DEFAULT_PRINT_SEPARATOR’ character. To
print an empty line write PRINT without arguments. By default the PRINT
instruction is evaluated every step. If the SKIP_STEP (SKIP_STATIC_STEP)
keyword is given, the instruction is processed only every the number of
transient (static) steps that results in evaluating the expression,
which may not be constant. The SKIP_HEADER_STEP keyword works similarly
for the optional HEADER but by default it is only printed once. The
SKIP_TIME keyword use time advancements to choose how to skip printing
and may be useful for non-constant time-step problems.
PRINTF
Instruction akin to C’s printf. Instruction akin to C’s printf executed
locally from all MPI ranks.
PRINTF PRINTF_ALL format_string [ expr_1 [ expr_2 [ ... ] ] ]
The format_string should be a printf-like string containing
double-precision format specifiers. A matching number of expressions
should be given. No newline is written if not explicitly asked for in
the format string with \n.
Do not ask for string literals %s.
As always, to get a literal % use %% in the format string.
PRINT_FUNCTION
Print one or more functions as a table of values of dependent and
independent variables.
PRINT_FUNCTION [ { function | expr } ... { function | expr } ]
[ FILE { | } ] [ HEADER ]
[ MIN ... ] [ MAX ... ]
[ STEP ... ] [ NSTEPs ... ]
[ FORMAT ] [ { vector | expr } ... { vector | expr } ]
Each argument should be either a function or an expression. The output
of this instruction consists of n + k columns, where n is the number of
arguments of the first function of the list and k is the number of
functions and expressions given. The first n columns are the arguments
(independent variables) and the last k one has the evaluated functions
and expressions. The columns are separated by a tabulator, which is the
format that most plotting tools understand. Only function names without
arguments are expected. All functions should have the same number of
arguments. Expressions can involve the arguments of the first function.
If the FILE keyword is not provided, default is to write to stdout. If
HEADER is given, the output is prepended with a single line containing
the names of the arguments and the names of the functions, separated by
tabs. The header starts with a hash # that usually acts as a comment and
is ignored by most plotting tools. If there is no explicit range where
to evaluate the functions and the first function is point-wise defined,
they are evalauted at the points of definition of the first one. The
range can be explicitly given as a product of n
ranges [x_(i, min ), x_(i, max )] for i = 1, …, n.
The values x_(i, min ) and x_(i, max ) are given with the MIN and MAX
keywords. The discretization steps of the ranges are given by either
STEP that gives δx or NSTEPS that gives the number of steps. If the
first function is not point-wise defined, the ranges are mandatory.
PRINT_VECTOR
Print the elements of one or more vectors, one element per line.
PRINT_VECTOR
[ FILE { | } ] [ HEADER ]
[ SEP ]
Each argument should be either a vector or an expression of the
integer i. If the FILE keyword is not provided, default is to write to
stdout. If HEADER is given, the output is prepended with a single line
containing the names of the arguments and the names of the functions,
separated by tabs. The header starts with a hash # that usually acts as
a comment and is ignored by most plotting tools. The SEP keyword expects
a string used to separate printed objects. To print objects without any
separation in between give an empty string like SEP "". The default is a
tabulator character ‘DEFAULT_PRINT_SEPARATOR’ character.
SOLVE
Solve a (small) system of non-linear equations.
SOLVE FOR UNKNOWNS ... [ METHOD { dnewton | hybrid | hybrids | broyden } ]
[ EPSABS ] [ EPSREL ] [ MAX_ITER ]
SORT_VECTOR
Sort the elements of a vector, optionally making the same rearrangement
in another vector.
SORT_VECTOR [ ASCENDING | DESCENDING ] [ ]
This instruction sorts the elements of into either ascending or
descending numerical order. If is given, the same
rearrangement is made on it. Default is ascending order.
VAR
Explicitly define one or more scalar variables.
VAR [ ] ... [ ]
When implicit definition is allowed (see IMPLICIT), scalar variables
need not to be defined before being used if from the context FeenoX can
tell that an scalar variable is needed. For instance, when defining a
function like f(x) = x^2 it is not needed to declare x explicitly as a
scalar variable. But if one wants to define a function like
g(x) = integral(f(x'), x', 0, x) then the variable x' needs to be
explicitly defined as VAR x' before the integral.
[IMPLICIT]: #implicit
VECTOR
Define a vector.
VECTOR SIZE [ FUNCTION_DATA ] [ DATA