4.2 Check for updates
If OpenFOAM was installed from the repository release, updating is rather simple. To update OpenFOAM
simply use Git to check if there are newer source files available. Change in the Terminal to the root directory
of the OpenFOAM installation and execute git pull.
If there are newer files in the repository Git will download them and display a summary of the changed files.
user @ host :∼$ cd $ FOAM_INST_DIR
user @ host :∼/ Ope n FOAM$ cd OpenFO AM -2 .1. x
user @ host :∼/ Op e nFOAM / OpenFOAM -2.1 . x$ git pull
rem ote : Cou n ting o b jects : 67 , done .
rem ote : Compre s s ing obj ects : 100% (13 /13) , done .
rem ote : T otal 44 ( delta 32) , reused 43 ( delta 31)
Unpa c king objects : 100% (44/44) , done .
From git :// g ithub . com / Op e nFOAM / OpenFOAM -2.1. x
72 f00f7 ..21 ed37 f master -> origin / m aste r
Upda ting 72 f00f7 ..21 e d37f
Fast - f orward
.../ ext rude / e x t r u d e T o R e g i o n M e s h / c r eateShellMesh . C | 10 + -
.../ ext rude / e x t r u d e T o R e g i o n M e s h / c r eateShellMesh . H | 7 + -
.../ extrudeToRegionMesh / extrudeToRegionMesh . C | 157 ++++++++ - - - - -
.../ Temp l ates / Ki n e m a t i c Cloud / Kinematic C l o u d .H | 6 + -
.../ Temp l ates / Ki n e m a t i c Cloud / KinematicCl o u d I .H | 7 +
.../ baseC l a s ses / kinemat i c C l o u d / kinematicCloud .H | 47 ++++++ -
6 files changed , 193 ins e r tions (+) , 41 d e letions ( -)
Listing 10: There are updates available
If OpenFOAM is up to date, then Git will output a corresponding message.
user @ host :∼/ Op e nFOAM / OpenFOAM -2.1 . x$ git pull
Alr eady up -to - date .
Listing 11: OpenFOAM is up to date
4.3 Check for updates only
If you want to check for updates only, without actually making an update, Git can be invoked using a special
option (see Listings 12 and 13). In this case Git only checks the repository and displays its findings without
actually making any changes. The option responsible for this is --dry-run. Notice, that git fetch is called
instead of git pull
8
.
user @ host :∼$ cd OpenF O AM / OpenFOAM -2.0. x/
user @ host :∼/ Op e nFOAM / OpenFOAM -2.0 . x$ git fetc h -- dry - run -v
rem ote : Cou n ting o b jects : 189 , done .
rem ote : Compre s s ing obj ects : 100% (57 /57) , done .
rem ote : T otal 120 ( delta 89) , reused 93 ( delta 62)
Rece i ving objects : 100% (1 20/120) , 1 7.05 KiB , done .
Reso l ving deltas : 100% ( 89/89) , c omplete d with 56 local ob jects .
From git :// g ithub . com / Op e nFOAM / OpenFOAM -2.0. x
5 ae28 02 .. 97 cf67d m aster -> orig in / master
user @ host :∼/ Op e nFOAM / OpenFOAM -2.0 . x$
Listing 12: Check for updates only – updates available
user @ host :∼$ cd OpenF O AM / OpenFOAM -2.1. x/
user @ host :∼/ Op e nFOAM / OpenFOAM -2.1 . x$ git fetc h -- dry - run -v
From git :// g ithub . com / Op e nFOAM / OpenFOAM -2.1. x
= [ up to date ] mas ter -> o rigin / mas ter
user @ host :∼/ Op e nFOAM / OpenFOAM -2.1 . x$
Listing 13: Check for updates only – up to date
8
git pull calls git fetch to download the remote files and then calls git merge to merge the retrieved files with the local files.
So checking for updates is actually done by git fetch.
I
This offering is not approved or endorsed by ESI® Group, ESI-OpenCFD® or the OpenFOAM®
Foundation, the producer of the OpenFOAM® software and owner of the OpenFOAM® trademark.
17