Commit Graph

656 Commits

Author SHA1 Message Date
Mark Olesen
b8c257d6ad CONFIG: adjustments to environment
- provide default WM_DIR if not already set, to improve robustness if a
  reduced environment is used

- add etc/ to WM_PROJECT_SITE search. This makes the site directory
  structure consistent with the OpenFOAM structure.
  Eg,

      WM_PROJECT_SITE/etc/..
      WM_PROJECT_SITE/bin/..
      WM_PROJECT_SITE/platforms/..

- Don't set/export WM_OSTYPE.  The default is POSIX and is properly
  defaulted throughout, including in CMakeLists-OpenFOAM.txt (also for
  Catalyst)
2018-12-03 09:50:48 +01:00
Mark Olesen
c5beee63f3 ENH: add isTrue function to RunFunctions
- check if the first argument corresponds to an OpenFOAM value for
  'true' (as per Switch).
  True == 't', 'y', 'true', 'yes', 'on'. Everything else is not true.

- when the first argument is '-dict', it initializes the value
  with a query via foamDictionary.
  Eg,
       isTrue -dict mydict -entry parallel

   ==> value=$(foamDictionary mydict -entry parallel -value)
       isTrue $value

   a missing entry is silently treated as false.

ENH: add getNumberOfPatchFaces function in RunFunctions

- simple extraction of nFaces from boundary file for given patch/region
2018-11-30 19:29:49 +01:00
Mark Olesen
9e094f1f07 ENH: relocate WM_PROJECT_SITE default (issue #1050)
- was PREFIX/site, now PROJECT/site

  This avoids several issues when installing OpenFOAM in clusters
  without an intermediate OpenFOAM-specific installation prefix.

  The 'site' directory may have a reserved meaning in these situations
  and it is undesirable to 'leak' upwards into the parent directory to
  look for configuration files.

  Placing the default within the project directory avoids this.
  Alternative locations can be given via the WM_PROJECT_SITE variable.
2018-11-29 18:04:44 +01:00
Mark Olesen
628b2445fc ENH: improve setup for paraview
- removed reliance on ParaView_INCLUDE_DIR variable for conveying the
  major.minor version information when compiling. This can be somewhat
  fragile and also adds variable that is an unnecessary when running
  (only used when compiling).

  Instead use `have_pvplugin_support` function in paraviewFunctions
  wmake script to determine the maj.min from the PV_PLUGIN_PATH
  since we have already defined the output path there with paraview
  maj.min numbering.

  Can now build with paraview from the operating system,
  provided that it has develop headers available.

      ParaView_VERSION=system

  In the etc/config.sh/paraview setup, the maj.min is taken from
  the corresponding `paraview --version` output and used when
  defining the PV_PLUGIN_PATH.

  During the build, the include path taken from `paraview-config`
  for a system installation, from the guess installation root
  of the paraview binary, or ParaView_DIR otherwise.

NB: using a system ParaView for building runTimePostProcessing is unsupported.

- these types of builds appear to have various library resolution issues
  (eg, libexpat not being loaded). Additionally, the build logic does
  not yet cover this type of use case.
2018-11-29 01:48:00 +01:00
Mark Olesen
e4b8fedeb1 ENH: do not foamCleanPath on system directories (issue #1102)
- skip /, /bin, /usr/bin ... as potential filters.
2018-11-28 19:19:10 +01:00
Mark Olesen
0446e73485 BUG: too many quotes on cleaned env variables
- Added quoting to handle spaces in environment values in commit 50852b33
  (#1007, #1008). However, quoting is only needed for eval mode.

  In regular mode, quoting should not be part of the output, instead it
  should be done on the caller side.
2018-11-25 09:21:42 +01:00
Mark Olesen
7964d31d03 STYLE: remove special '.' version handling in foamEtcFile
- this would automatically change openfoam<digits> into maj.min.rel
  values, thus transforming openfoam1806 into a version "1.8.0.6" !
2018-11-24 00:36:31 +01:00
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
1456a8ca1d STYLE: emit warning about using deprecated "~OpenFOAM" expansion
- Within strings it is preferable to use the "<etc>" instead.
  Most use cases for the old "~OpenFOAM" expansion have been obsoleted
  by the #includeEtc directive.
2018-11-23 13:12:33 +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
481e83f007 STYLE: adjust shell syntax and usage output for paraFoam
- have -help-full as the last entry in the list of options.
  This permits some optimizations when generating shell completions.
2018-11-21 09:44:00 +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
50852b3392 CONFIG: improve shell env handling of paths with spaces (#1007, #1008)
- foamCleanPath now only splits the environment variable on ':', which
  allows other directories with spaces or '(..)' etc to pass through
  without major issue.

- The filter arguments are split on whitespace, colons or semi-colons.
2018-10-15 21:37:46 +02:00
Mark Olesen
19d600472a ENH: auto-detect git in tutorials Alltest 2018-10-12 23:29:16 +02:00
Andrew Heather
54457c68b6 Merge remote-tracking branch 'origin/master' into develop 2018-09-21 16:01:16 +01:00
Andrew Heather
8d582d0258 BUG: foamLog - corrected for Ubuntu. See #860 2018-09-12 08:42:04 +01: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
Mark Olesen
3bc35220b0 GIT: relocate bin/mergedDyM -> bin/deprecated/mergedDyMsolver
- the backend script should not be accessible from the PATH.
  Using deprecated/ adds a level of documentation.
2018-06-27 07:54:28 +02:00
Andrew Heather
007c766914 ENH: Script updates 2018-06-26 14:04:00 +01: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
4300f4c02f ENH: improve flexiblity of foamCreateVideo (issue #904)
- respect trailing '-', '.', '_' for the image prefix name.
  For example,

    -image press_   to accept press_*.png

- additional -mask width option (for avconv)
2018-06-24 18:02:00 +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
Andrew Heather
c909a5df25 GIT: resolved merge conflict 2018-06-13 14:20:18 +01: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
6d89a3ec38 ENH: additional convenience for mpirunDebug
- a -valgrind option for logging with valgrind

- determine number of processors from system/decomposeParDict
  or -decomposeParDict if -np was not specified
2018-05-02 11:49:33 +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
e2332d6bd2 COMP: better handling of versioned cmake libraries
- sentinel was not working properly when building user-space routines
2018-01-31 08:35:56 +01:00
Mark Olesen
de4a1eeedb CONFIG: improve evaluation of arguments for foamEtcFile
- forward command-line arguments for paraview, where they may also be
  evaluated (cshrc, POSIX shell)
  Eg,
      . etc/bashrc ParaView_VERSION=5.4.1-mpipy
      source etc/cshrc ParaView_VERSION=5.4.1-mpipy
2018-01-24 12:15:09 +01:00
Mark Olesen
ff07ae1520 CONFIG: typo in config.csh/mpi
- also handle stray semi-colons in foamCleanPath.
  Treat like a ':' separator.
  They are incorrect and potentially problematic for shell evals.
2018-01-16 12:00:21 +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
c093095444 ENH: improve robustness of foamSearch (fixes #700) 2018-01-09 17:28:11 +01:00
Mark Olesen
c5f4dbd866 ENH: foamRunTutorials now skips tutorials with Allrun-optional
- for tutorials that are known to run poorly, can provide a
  placeholder Allrun-optional instead of the usual Allrun script.
  If this is detected, the case will be skipped.
2018-01-09 16:44:32 +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
Henry Weller
255ec7366b ENH: multiphaseInterFoam: Merged dynamic mesh functionality of multiphaseInterDyMFoam into multiphaseInterFoam
and replaced multiphaseInterDyMFoam with a script which reports this change.

The multiphaseInterDyMFoam tutorials have been moved into the multiphaseInterFoam directory.

This change is one of a set of developments to merge dynamic mesh functionality
into the standard solvers to improve consistency, usability, flexibility and
maintainability of these solvers.

Henry G. Weller
CFD Direct Ltd.
2017-12-01 15:51:21 +00:00
Henry Weller
ede4759b80 ENH: interFoam: Merged dynamic mesh functionality of interDyMFoam into interFoam
and replaced interDyMFoam with a script which reports this change.

The interDyMFoam tutorials have been moved into the interFoam directory.

This change is one of a set of developments to merge dynamic mesh functionality
into the standard solvers to improve consistency, usability, flexibility and
maintainability of these solvers.

Henry G. Weller
CFD Direct Ltd.

interMixingFoam, multiphaseInterFoam: Updated for changes to interFoam
2017-11-30 23:56:42 +00:00
Henry Weller
2f888d1684 ENH: rhePimpleFoam: Merged dynamic mesh functionality of rhoPimpleDyMFoam into rhoPimpleFoam
and replaced rhoPimpleDyMFoam with a script which reports this change.

The rhoPimpleDyMFoam tutorials have been moved into the rhoPimpleFoam directory.

This change is the first of a set of developments to merge dynamic mesh
functionality into the standard solvers to improve consistency, usability,
flexibility and maintainability of these solvers.

Henry G. Weller
CFD Direct Ltd.

rhoReactingFoam: Updated for changes to rhoPimpleFoam files
2017-11-23 12:13:37 +00:00