Skip to content
Snippets Groups Projects
  1. Jun 04, 2019
  2. Jun 03, 2019
  3. Jun 04, 2019
  4. Jun 03, 2019
  5. May 31, 2019
  6. May 23, 2019
    • Andrew Heather's avatar
      ENH: Added new hydrostatic pressure function object · 1523160c
      Andrew Heather authored
      Calculates and outputs the pressure fields p_rgh and ph_rgh based on the
      option that was previously hard-coded in the fireFoam solver
      
      Usage
          Example of function object specification to calculate hydrostatic pressure:
          \verbatim
          hydrostaticPressure1
          {
              type        hydrostaticPressure;
              libs        ("libinitialisationFunctionObjects.so");
              ...
          }
          \endverbatim
      
          Where the entries comprise:
          \table
              Property     | Description             | Required    | Default value
              log          | Log to standard output  | no          | yes
              p_rgh        | Name of p_rgh field     | no          | p_rgh
              ph_rgh       | Name of ph_rgh field    | no          | ph_rgh
              pRef         | Name of pressure ref field | no       | pRef
              rho          | Name of density field   | no          | rho
              U            | Name of velocity field  | no          | U
              gh           | Name of gravity*height volume field  | no | gh
              ghf          | Name of gravity*height surface field | no | ghf
              nCorrectors  | Number of correctors when solving ph_rgh | no | 5
          \endtable
      
      Note
          Calculates the hydrostatic pressure on construction/re-initialisation;
          the execute and write functions are not used.
      1523160c
  7. May 30, 2019
  8. May 29, 2019
  9. May 23, 2019
  10. May 31, 2019
  11. Feb 03, 2019
  12. May 28, 2019
  13. Feb 10, 2019
  14. May 27, 2019
  15. May 25, 2019
    • Mark OLESEN's avatar
      COMP: force dlOpen for windows application binaries (#1238) · 66a10099
      Mark OLESEN authored
      - when windows portable executables (.exe or .dll) files are loaded,
        their dependent libraries not fully loaded. For OpenFOAM this means
        that the static constructors which are responsible for populating
        run-time selection tables are not triggered, and most of the run-time
        selectable models will simply not be available.
      
      Possible Solution
      =================
      
        Avoid this problem by defining an additional library symbol such as
        the following:
      
            extern "C" void libName_Load() {}
      
        in the respective library, and tag this symbol as 'unresolved' for
        the linker so that it will attempt to resolve it at run-time by
        loading the known libraries until it finds it. The link line would
        resemble the following:
      
            -L/some/path -llibName -ulibName_Load
      
        Pros:
          - Allows precise control of forced library loading
      
        Cons:
          - Moderately verbose adjustment of some source files (even with macro
            wrapping for the declaration).
          - Adjustment of numerous Make/options files and somewhat ad hoc
            in nature.
          - Requires additional care when implementing future libraries and/or
            applications.
      
        - This is the solution taken by the symscape patches (Richard Smith)
      
      Possible Solution
      =================
      
        Avoid this problem by simply force loading all linked libraries.
        This is done by "scraping" the information out of the respective
        Make/options file (after pre-processing) and using that to define
        the library list that will be passed to Foam::dlOpen() at run-time.
      
        Pros:
          - One-time (very) minimal adjustment of the sources and wmake toolchain
          - Automatically applies to future applications
      
        Cons:
          - Possibly larger memory footprint of application (since all dependent
            libraries are loaded).
          - Possible impact on startup time (while loading libraries)
          - More sensitive to build failures. Since the options files are
            read and modified based on the existence of the dependent
            libraries as a preprocessor step, if the libraries are initially
            unavailable for the first attempt at building the application,
            the dependencies will be inaccurate for later (successful) builds.
      
        - This is solution taken by the bluecape patches (Bruno Santos)
      
      Adopted Solution
      ================
      
        The approach taken by Bruno was adopted in a modified form since
        this appears to be the most easily maintained.
      
      Additional Notes
      ================
      
        It is always possible to solve this problem by defining a corresponding
        'libs (...)' entry in the case system/controlDict, which forces a dlOpen
        of the listed libraries. This is obviously less than ideal for large-scale
        changes, but can work to resolve an individual problem.
      
        The peldd utility (https://github.com/gsauthof/pe-util), which is
        also packaged as part of MXE could provide yet another alternative.
        Like ldd it can be used to determine the library dependencies of
        binaries or libraries. This information could be used to define an
        additional load layer for Windows.
      66a10099