1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
|
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.
- In particular, FeenoX is particularly well suited to be incldued in
workflows involving LLMs and/or AI agents.
- official Debian and Ubuntu packages built on Salsa from the source
tarballs.
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.”
- can be created using assistance from LLMs and AI agents.
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
- Elasticity (small and large strain)
- 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
[Elasticity (small and large strain)]: 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
|