Skip to content
Snippets Groups Projects
user avatar
Mark Olesen authored
- It is incorrect to prefix the assignment with an 'export' since this
  automatically marks the overall command as successful and circumvents
  the fallback.

  There is no simple way to have proper behaviour when sourced with a
  local directory path, but at least it now uses the fallback.

  It is still easy to wreak the mechanism with valid but confusing input.
  For example,

     ". /path/to/openfoam/etc/././bashrc"

  The only real certainty is that "${BASH_SOURCE%/*}"
  should point to the 'etc/' directory. In which case,

      cd ${BASH_SOURCE%/*}    # <- now in the etc/ directory
      pwd=$(pwd -P)           # <- fully-qualified path to etc/
      pwd=${pwd%/*/*}         # <- up two parent levels

  - This works with ". ./bashrc", but fails with ". bashrc"
    (probably not so common).
  - Con: The construct requires an additional sub-shell.
b8448671

About OpenFOAM

OpenFOAM is a free, open source CFD software package developed primarily by OpenCFD since 2004 and is currently distributed by ESI-OpenCFD and the OpenFOAM Foundation. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. More...

OpenFOAM+ uses the OpenFOAM Foundation version as a common code base, with wider functionality and platform support. Its purpose is to accelerate the public availability of new features which are sponsored by OpenCFD's customers and contributed by the OpenFOAM community.

Copyright

OpenFOAM+ 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. See the file COPYING in this directory or http://www.gnu.org/licenses/, for a description of the GNU General Public License terms under which you can copy the files.

OpenFOAM Trademark

OpenCFD Limited, owner of the OpenFOAM Trademark, has granted the use of the Trademark to the OpenFOAM Foundation. Violations of the Trademark are continuously monitored and will be duly prosecuted. Please contact OpenCFD if you have any questions on the use of the OpenFOAM trademark.

Useful Links

Copyright 2016 OpenCFD Ltd