Commit Graph

284 Commits

Author SHA1 Message Date
Mark Olesen
b105f926b1 ENH: improvements to foamConfigurePaths tool (#1010)
- provide edit for adjusting the ThirdParty and fallback site variables.
  This is useful when packaging into a single directory, and possibly
  without any ThirdParty dependencies.

- support '-prefix' (similar to auotconfig) as an alternative to
  '-foamInstall'. Use this prefix to set the prefix directly.
  Bypasses and disables the bash sourcing magic.
2018-11-23 15:30:29 +01:00
Mark Olesen
8f4067015d STYLE: remove shebang from LogFunctions
- file is to be sourced, non-executable.

- remove stray .keep file from tutorial case
2018-11-22 17:31:34 +01:00
Mark Olesen
5187aa13aa ENH: improve output formatting for usage information
- generalize output text wrapping, use for usage notes

- add -help-man option for generating manpage content for any OpenFOAM
  application or solver.

  bin/tools/foamCreateManpage as helper
2018-11-21 19:55:28 +01:00
Mark Olesen
50ccb197dc BUG: fix bad environment parsing in foamCreateModuleInclude
- The changes in foamCleanPath introduced for issues (#1007, #1008)
  include quoted output of the cleaned environment variable.
  When used in foamCreateModuleInclude, the quotes make their way
  into the final environment. Avoid this by using the -sh-env
  eval format instead.

- add environment extraction of MANPATH changes
2018-11-21 11:02:58 +01:00
Mark Olesen
31c21031ea ENH: reduce intermediate text with generating completion options
- more filtering in the sed stage to remove non-essential text.
  Terminate parsing on first appearance of -help-full option.
2018-11-21 10:51:57 +01:00
Mark Olesen
698bf3f61d STYLE: usage order in foamConfigurePaths 2018-11-19 15:38:14 +01:00
Mark Olesen
5029d29ff6 ENH: support -gcc option for foamConfigurePaths
- simplifies things for legacyCompile
2018-11-15 13:55:21 +01:00
Mark Olesen
19d600472a ENH: auto-detect git in tutorials Alltest 2018-10-12 23:29:16 +02:00
Mark Olesen
e0f83938ee ENH: ignore -noFunctionObjects option when disabled
- With argList::noFunctionObjects() we use the logic added in
  4b93333292 (issue #352)

  By removing the '-noFunctionObjects' option, we automatically
  suppress the creation of function-objects via Time (with argList
  as a parameter).
  There is generally no need in these cases for an additional

      runTime.functionObjects().off()  statement

  Use the argList::noFunctionObjects() for more direct configuration
  and reduce unnecessary clutter in the -help information.

  In previous versions, the -noFunctionObjects would have been redundant
  anyhow, so we can also just ignore it now instead.
2018-08-08 09:44:28 +02:00
Mark Olesen
cf7bd82c25 STYLE: fix tools/lib-dir -help output 2018-08-07 11:19:10 +02:00
Andrew Heather
59b4a77d23 TUT: RunFunctions - added protection for user shell customisations 2018-06-26 11:51:02 +01:00
Mark Olesen
831a47b81e CONFIG: eliminate most occurances of outdated FOAM_INST_DIR (issue #444)
- since 1612, FOAM_INST_DIR and foamInstDir longer have any
  special meanings when sourcing the bashrc or cshrc files.
  Thus no need for special treatment in any of the dispatch wrappers.

  Retained FOAM_INST_DIR as (unexported) variable in etc/bashrc,
  just in case people are using patched versions of etc/bashrc
  as part of their installation.

ENH: relax prefix restrictions on foamCreateVideo (issue #904)

- shift the implicit '.' to be part of the default prefix. This allows
  things like "-image myimages_00" to work as might be expected.
2018-06-25 09:56:34 +02:00
Mark Olesen
b68fe2c76d BUG: cleanCase deletes blockMeshDict (fixes #900)
- Don't remove the constant/polyMesh directory if it contains a
  blockMeshDict or blockMeshDict.m4 file. Offer a reminder that
  system/ is the normal place for it.
2018-06-22 14:50:25 +02:00
Mark Olesen
6390c18381 ENH: suppress Info output for some cases (issue #722, #893)
- add additional control via a Foam::infoDetailLevel flag, which is
  supported by a 'DetailLevel' macro.  Eg,

      DetailLevel << "some information" << nl

- When infoDetailLevel is zero, the stdout for all Foam::system() calls
  are also redirected to stderr to prevent child output from
  appearing on the parent.

- close stdin before exec in system call.
2018-06-22 12:26:33 +02:00
Mark Olesen
6ac47e6db5 STYLE: consistent foamDictionary stderr redirect in RunFunctions 2018-06-19 13:56:30 +02:00
Mark Olesen
d637b6eb78 ENH: avoid parse problems caused by #calc directives (fixes #722)
- The additional output generated by #calc directives in the
  controlDict or decomposeParDict causes issues for the RunFunctions
  extraction of 'application' and 'numberOfSubdomains'.

  Avoid by using -disableFunctionEntries, which also has the side-effect
  of disabling '#include'.
2018-06-19 12:38:53 +02:00
Mark Olesen
f0a92b11d1 STYLE: adjust AMI information (issue #860)
- use "min:xxx" for consistency with other outputs

- adjust decompositionInformation as well
2018-06-13 15:26:59 +02:00
Mark Olesen
63d07c9ef8 ENH: adjust AMI information for better log processing (issue #860)
- now report as  "min = XX max = YY average = ZZ"
  instead of as  "min/max/average = XX, YY, ZZ"

  this makes it easier to parse any particular value
  (eg, with foamLog)
2018-06-08 13:43:40 +02:00
Mark Olesen
b4d38ab468 ENH: improve handling of ThirdParty packages
- generalize some of the library extensions (.so vs .dylib).
  Provide as wmake 'sysFunctions'

- added note about unsupported/incomplete system support

- centralize detection of ThirdParty packages into wmake/ subdirectory
  by providing a series of scripts in the spirit of GNU autoconfig.
  For example,

      have_boost, have_readline, have_scotch, ...

  Each of the `have_<package>` scripts will generally provide the
  following type of functions:

      have_<package>          # detection
      no_<package>            # reset
      echo_<package>          # echoing

  and the following type of variables:

      HAVE_<package>          # unset or 'true'
      <package>_ARCH_PATH     # root for <package>
      <package>_INC_DIR       # include directory for <package>
      <package>_LIB_DIR       # library directory for <package>

  This simplifies the calling scripts:

      if have_metis
      then
          wmake metisDecomp
      fi

  As well as reducing clutter in the corresponding Make/options:

      EXE_INC = \
          -I$(METIS_INC_DIR) \
          -I../decompositionMethods/lnInclude

      LIB_LIBS = \
          -L$(METIS_LIB_DIR) -lmetis

  Any additional modifications (platform-specific or for an external build
  system) can now be made centrally.
2018-04-24 14:51:19 +02:00
Mark Olesen
5037634bd1 CONFIG: return instead of exit in lib-dir script
- affected csh users
2018-04-17 11:45:44 +02:00
Mark Olesen
c2da3424bb SUBMODULE: catalyst function object
- now uses current OpenFOAM code level

- added initial catalyst script for insitu processing of overset
2018-04-12 16:25:42 +02:00
Mark Olesen
fe140cd6c5 TUT: test mode not respected (closes #710)
- now replaced 'if ! isTest' with 'if notTest' for most cases.
2018-02-20 12:54:44 +01:00
Mark Olesen
110b00f048 ENH: improved handling of gmp/mpfr library settings (issue #674)
- export library path for gmp/mpfr from CGAL config files.
  This is required when non-system gmp/mpfr libraries are being
  used, but not using a ThirdParty compiler installation.

- automatically handle lib/ vs lib64/ (eg, for central installations)
  for packages such as boost, CGAL, etc. While the ThirdParty
  compilation of these will normally land in lib64/, this may not be
  the case when they are supplied by another means.

- reworked the handling of foamEtcFile and foamCleanPath for less
  clutter in the configuration files.
  Added the bin/tools/lib-dir script to handle logic that is
  too complex to easily manage in csh.
2018-01-11 01:30:23 +01:00
Mark Olesen
9c38ad6ae4 TUT: relocate tutorial log analysis as functions for reuse in modules
- removed some unneeded tutorial files
2017-12-21 14:17:20 +01:00
Mark Olesen
19c3875a14 CONFIG: update tcsh completion_cache to include finiteArea and cfmesh
- include bash completion for paraFoam, and provision for using
  foamEtcFile as well.
2017-12-18 14:26:49 +01:00
Andrew Heather
50d1ac15ef INT: Integration updates in preparation for merge into the develop branch 2017-09-27 09:30:59 +01:00
Hrvoje Jasak
0c64622341 Finite area port, Hrvoje Jasak
- with sphereSurfactantFoam and sphereTransport test case
2017-09-15 12:02:25 +01:00
Mark Olesen
22775693d5 STYLE: adjust comments, indentation 2017-12-17 13:14:05 +01:00
Mark Olesen
1f9bdb4b4f CONFIG: add foamConfigurePaths -kahip* options (closes #666) 2017-12-15 18:04:11 +01:00
Mark Olesen
bc8420e14f STYLE: trailing whitespace, doxygen, error messages from fileOperation 2017-12-13 17:56:34 +01:00
Mark Olesen
5947f9a337 ENH: more succinct output from command-line errors.
- unknown options or missing option values now emit a shorter message
  without the entire usage. This makes it easier to identify the errors
  and is better aligned with the behaviour of GNU system tools.

  ====
     $ simpleFoam -case
     Using: OpenFOAM-plus (see www.OpenFOAM.com)
     Build: plus-01234

     Error: option '-case' requires an argument

     See 'simpleFoam -help' for usage
  ====

- provide for reduced (-help) and full (-help-full) usage information.
  In many cases the reduced usage provided sufficient and easier
  to find the information.

- make -srcDoc an alias for -doc-source

- no warnings about option aliases for future dates.
2017-11-24 10:27:11 +01:00
Andrew Heather
6fd27353e4 STYLE: improve formatting of doxygen filter output 2017-11-10 14:53:18 +01:00
Mark Olesen
24d8c891d7 ENH: add bin/tools/foamCreateModuleInclude
- support when creating modules for OpenFOAM.
  Original source from Ivan Spisso (CINECA) modified by OpenCFD
2017-11-13 07:46:17 +01:00
Mark Olesen
590b319a78 TUT: 'restore0Dir -processors' with filtering of #include files 2017-11-04 14:59:59 +01:00
Mark Olesen
ebd922a32e ENH: support longer doxygen brief descriptions. 2017-11-04 14:26:38 +01:00
Mark Olesen
c792a9d7df TUT: script cleanup, provide cleanCase0 for commonly used operation 2017-10-12 19:20:56 +02:00
Mark Olesen
ce0868106a ENH: use bash associative array for on-the-fly completion (issue #551)
- this reduces the number of functions and allows lazy loading of
  completion options, which makes it easy to quickly add any other
  OpenFOAM application in completion.

  The generic '_of_complete_' function handles (bash) completion for
  any OpenFOAM application. On the first call for any particular
  application, it retrieves the available options from the application
  help output and adds this information to its environmental cache for
  subsequent use.

- Tcsh completion uses the same function via a bash wrapper.
  But since its wrapper is transient, the on-the-fly generation would
  be less efficient. For this case, a pre-generated completion_cache
  can be used, which is generated with

      bin/tools/foamCreateCompletionCache
2017-08-08 13:17:36 +02:00
Mark Olesen
78da7dbd7a CONFIG: additional filenames completion for bash_completion
- handles the case where we are currently completing something that
  does not appear to be an option. For example,

      foamDictionary -expanded someD[TAB]

  should complete the filename, not present more options.
2017-08-03 10:47:42 +02:00
Mark Olesen
c614110d46 ENH: improve bash completion functionality (issue #551)
- use complete -o filenames, dropped -o nospace to make it more responsive.

- restructure completion code to use a unified backend, which makes it easier
  understand, maintain and re-use.

- foamCreateBashCompletions now simply outputs to a stdout, and allows
  quick generation of completion of single applications.

- add -fileHandler completion in anticipation of future changes there.

- relocated as etc/config.s/bash_completion to prevent inadvertently
  having two versions (.com, .org) installed at the same time.
2017-07-31 15:35:40 +02:00
Mark Olesen
c50368ecc6 ENH: add trapFpe and setNaN optimisationSwitch (issue #517)
- allows configuration without an environment variable.
  For compatibility still respect FOAM_SIGFPE and FOAM_SETNAN
  env-variables

- The env-variables are now treated as true/false switch values.
  Previously there was just a check for env exists or not, but this
  can be fairly fragile for a user's environment.
2017-07-05 17:49:37 +02:00
Mark Olesen
02edc5b206 STYLE: tabs and line length in files, very dubious NULL in ensight reader.
- disable automatically upgrading copyrights in files since changes to
  not automatically imply a change in copyright. Eg, fixing a typo in
  comments, or changing a variable from 'loopI' to 'loopi' etc.
2017-06-26 13:43:05 +02:00
Mark Olesen
4971cedc2a CONFIG: cleanup bash completions in unset 2017-06-26 11:09:05 +02:00
Mark Olesen
8005e2b4a2 ENH: add cloneParallelCase function into bin/tools/RunFunctions 2017-06-22 14:45:53 +01:00
Mark Olesen
feab8e94a8 ENH: restrict aliases, completions to interactive shells
- minor cleanup of bash completion script
2017-06-21 08:09:15 +01:00
Mark Olesen
d794f599d8 ENH: added bin/tools/ change-sitedir.sh, change-userdir.sh
- can be useful with compiling additional OpenFOAM programs
  that use FOAM_USER_APPBIN, FOAM_USER_LIBBIN for their build,
  to avoid conflicts with the normal user bin/lib files.

- or to force relocation of FOAM_SITE_APPBIN, FOAM_SITE_LIBBIN
  during packaging of OpenFOAM
2017-04-07 09:10:06 +02:00
Mark Olesen
b970ba0901 ENH: minor improvements to environment
- handle sourcing bashrc with a relative path (issue #383)
- handle sourcing from bash and zsh.
  Still need manual intervention when sourcing dash, sh, or ksh.
- replace grep in etc/cshrc with sed only
- logical instead of physical path for WM_PROJECT_DIR (issue #431).
  Doesn't seem to be possible for csh/tcsh.

  * Continue using physical locations when comparing directories,
    but not for the top-level FOAM_INST_DIR, WM_PROJECT_DIR.

- relocate WM_CC, WM_CXX overrides from etc/config.*/compiler
  to etc/config.*/settings to ensure that they are left untouched
  when etc/config.sh/compiler is sourced while making third-party
  packages (eg, gcc, llvm, CGAL).

- provide fallback FOAM_TUTORIALS setting in RunFunctions

STYLE: remove "~OpenFOAM" fallback as being too rare, non-obvious
2017-03-20 08:57:12 +01:00
Mark Olesen
31555346cc Merge remote-tracking branch 'origin/master' into develop 2017-03-10 13:30:39 +01:00
Mark Olesen
973cf0397d CONFIG: provide foamConfigurePaths -mpi option
- makes it easier to switch between mpi implementations (eg, openmpi, intelmpi etc)

- add comment about compiler setting for KNL
2017-02-16 09:14:17 +01:00
Mark Olesen
957635200a ENH: build into build/ directory instead of platforms/ (issue #312)
- makes it slightly easier when packaging various binaries, or when
  building packages for installation via modules etc.
2017-02-10 20:30:15 +01:00
Mark Olesen
0067c9e369 STYLE: avoid spurious messages when cloning cases
- either (or both) of 0/, 0.orig/ may exist, so error messages about
  one of them being missing is a bit misleading
2017-02-09 13:41:48 +01:00