1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.5.3" />
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.0em;
131 div
.content
{ /* Block element content. */
135 /* Block element titles. */
136 div
.title
, caption
.title
{
138 font-family: sans-serif
;
142 margin-bottom: 0.5em;
148 td div
.title:first-child
{
151 div
.content div
.title:first-child
{
154 div
.content
+ div
.title
{
158 div
.sidebarblock
> div
.content
{
160 border: 1px solid silver
;
164 div
.listingblock
> div
.content
{
165 border: 1px solid silver
;
170 div
.quoteblock
, div
.verseblock
{
174 border-left: 5px solid
#dddddd;
178 div
.quoteblock
> div
.attribution
{
183 div
.verseblock
> pre
.content
{
184 font-family: inherit
;
186 div
.verseblock
> div
.attribution
{
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div
.verseblock
+ div
.attribution
{
195 div
.admonitionblock
.icon
{
199 text-decoration: underline
;
201 padding-right: 0.5em;
203 div
.admonitionblock td
.content
{
205 border-left: 3px solid
#dddddd;
208 div
.exampleblock
> div
.content
{
209 border-left: 3px solid
#dddddd;
213 div
.imageblock div
.content
{ padding-left: 0; }
214 span
.image img
{ border-style: none
; }
215 a
.image:visited
{ color: white
; }
219 margin-bottom: 0.8em;
232 list-style-position: outside
;
235 list-style-type: decimal
;
238 list-style-type: lower-alpha
;
241 list-style-type: upper-alpha
;
244 list-style-type: lower-roman
;
247 list-style-type: upper-roman
;
250 div
.compact ul
, div
.compact ol
,
251 div
.compact p
, div
.compact p
,
252 div
.compact div
, div
.compact div
{
254 margin-bottom: 0.1em;
257 div
.tableblock
> table
{
258 border: 3px solid
#527bbd;
260 thead
, p
.table
.header
{
261 font-family: sans-serif
;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div
.tableblock
> table
[frame
="void"] {
277 div
.tableblock
> table
[frame
="hsides"] {
278 border-left-style: none
;
279 border-right-style: none
;
281 div
.tableblock
> table
[frame
="vsides"] {
282 border-top-style: none
;
283 border-bottom-style: none
;
289 margin-bottom: 0.8em;
292 padding-bottom: 15px;
294 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
300 padding-right: 0.8em;
306 div
.hdlist
.compact tr
{
315 .footnote, .footnoteref {
319 span
.footnote
, span
.footnoteref
{
320 vertical-align: super
;
324 margin: 20px 0 20px 0;
328 #footnotes div
.footnote
{
334 border-top: 1px solid silver
;
344 div#footer-badges
{ display: none
; }
348 margin-bottom: 2.5em;
353 font-family: sans-serif
;
357 margin-bottom: 0.1em;
360 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
376 /* Workarounds for IE6's broken and incomplete CSS2. */
378 div
.sidebar-content
{
380 border: 1px solid silver
;
383 div
.sidebar-title
, div
.image-title
{
385 font-family: sans-serif
;
388 margin-bottom: 0.5em;
391 div
.listingblock div
.content
{
392 border: 1px solid silver
;
397 div
.quoteblock-attribution
{
402 pre
.verseblock-content
{
403 font-family: inherit
;
405 div
.verseblock-attribution
{
410 div
.exampleblock-content
{
411 border-left: 3px solid
#dddddd;
415 /* IE6 sets dynamically generated links as visited. */
416 div#toc
a:visited
{ color: blue
; }
418 <script type=
"text/javascript">
420 window
.onload = function(){asciidoc
.footnotes(); asciidoc
.toc(2);}
421 var asciidoc
= { // Namespace.
423 /////////////////////////////////////////////////////////////////////
424 // Table Of Contents generator
425 /////////////////////////////////////////////////////////////////////
427 /* Author: Mihai Bazon, September 2002
428 * http://students.infoiasi.ro/~mishoo
430 * Table Of Content generator
433 * Feel free to use this script under the terms of the GNU General Public
434 * License, as long as you do not remove or alter this notice.
437 /* modified by Troy D. Hanson, September 2006. License: GPL */
438 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
441 toc: function (toclevels
) {
443 function getText(el
) {
445 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
446 if (i
.nodeType
== 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
448 else if (i
.firstChild
!= null)
454 function TocEntry(el
, text
, toclevel
) {
457 this.toclevel
= toclevel
;
460 function tocEntries(el
, toclevels
) {
461 var result
= new Array
;
462 var re
= new RegExp('[hH]([2-'+(toclevels
+1)+'])');
463 // Function that scans the DOM tree for header elements (the DOM2
464 // nodeIterator API would be a better technique but not supported by all
466 var iterate = function (el
) {
467 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
468 if (i
.nodeType
== 1 /* Node.ELEMENT_NODE */) {
469 var mo
= re
.exec(i
.tagName
);
470 if (mo
&& (i
.getAttribute("class") || i
.getAttribute("className")) != "float") {
471 result
[result
.length
] = new TocEntry(i
, getText(i
), mo
[1]-1);
481 var toc
= document
.getElementById("toc");
482 var entries
= tocEntries(document
.getElementById("content"), toclevels
);
483 for (var i
= 0; i
< entries
.length
; ++i
) {
484 var entry
= entries
[i
];
485 if (entry
.element
.id
== "")
486 entry
.element
.id
= "_toc_" + i
;
487 var a
= document
.createElement("a");
488 a
.href
= "#" + entry
.element
.id
;
489 a
.appendChild(document
.createTextNode(entry
.text
));
490 var div
= document
.createElement("div");
492 div
.className
= "toclevel" + entry
.toclevel
;
493 toc
.appendChild(div
);
495 if (entries
.length
== 0)
496 toc
.parentNode
.removeChild(toc
);
500 /////////////////////////////////////////////////////////////////////
501 // Footnotes generator
502 /////////////////////////////////////////////////////////////////////
504 /* Based on footnote generation code from:
505 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
508 footnotes: function () {
509 var cont
= document
.getElementById("content");
510 var noteholder
= document
.getElementById("footnotes");
511 var spans
= cont
.getElementsByTagName("span");
514 for (i
=0; i
<spans
.length
; i
++) {
515 if (spans
[i
].className
== "footnote") {
517 // Use [\s\S] in place of . so multi-line matches work.
518 // Because JavaScript has no s (dotall) regex flag.
519 note
= spans
[i
].innerHTML
.match(/\s*\[([\s\S]*)]\s*/)[1];
520 noteholder
.innerHTML
+=
521 "<div class='footnote' id='_footnote_" + n
+ "'>" +
522 "<a href='#_footnoteref_" + n
+ "' title='Return to text'>" +
523 n
+ "</a>. " + note
+ "</div>";
525 "[<a id='_footnoteref_" + n
+ "' href='#_footnote_" + n
+
526 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
527 var id
=spans
[i
].getAttribute("id");
528 if (id
!= null) refs
["#"+id
] = n
;
532 noteholder
.parentNode
.removeChild(noteholder
);
534 // Process footnoterefs.
535 for (i
=0; i
<spans
.length
; i
++) {
536 if (spans
[i
].className
== "footnoteref") {
537 var href
= spans
[i
].getElementsByTagName("a")[0].getAttribute("href");
538 href
= href
.match(/#.*/)[0]; // Because IE return full URL.
541 "[<a href='#_footnote_" + n
+
542 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
555 <span id=
"author">Michael Wild
</span><br />
556 <span id=
"email"><tt><<a href=
"mailto:themiwi@users.sourceforge.net">themiwi@users.sourceforge.net
</a>></tt></span><br />
558 <div id=
"toctitle">Table of Contents
</div>
559 <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.
</b></p></noscript>
564 <div class=
"sectionbody">
565 <div class=
"paragraph"><p><a href=
"http://freefoam.sourceforge.net">http://freefoam.sourceforge.net
</a></p></div>
568 <h2 id=
"_building_freefoam">Building FreeFOAM
</h2>
569 <div class=
"sectionbody">
570 <div class=
"ulist"><ul>
573 Install the prerequisites documented in the
<a href=
"README.html">README
</a> file. If
574 your distribution does not have
<em>METIS
</em>,
<em>ParMetis
</em>,
<em>MGRIDGEN
</em> or
<em>libccmio
</em>
575 be not worried, FreeFOAM can handle those for you.
580 Download the FreeFOAM source and unpack it somewhere convenient. For the
581 further instructions we will use
<tt>$HOME/Source/
</tt>.
583 <div class=
"listingblock">
584 <div class=
"content">
585 <pre><tt>$ mkdir -p $HOME/Source
587 $ wget http://master.dl.sourceforge.net/sourceforge/freefoam/freefoam-{fullver}.tar.bz2
588 $ tar xjf freefoam-{fullver}.tar.bz2
</tt></pre>
593 Create a build tree and
<em>cd
</em> into it:
595 <div class=
"listingblock">
596 <div class=
"content">
597 <pre><tt>$ mkdir $HOME/Source/freefoam-{fullver}-build
598 $ cd $HOME/Source/freefoam-{fullver}-build
</tt></pre>
603 Start CMake-configuration:
605 <div class=
"listingblock">
606 <div class=
"content">
607 <pre><tt>$ ccmake $HOME/Source/freefoam-{fullver}
</tt></pre>
612 Press the
<tt>c
</tt> key. Use the arrow keys to navigate up and down and press
613 <tt>enter
</tt> to edit a field. To commit the change, press
<tt>enter
</tt> again, or
<tt>ESC
</tt>
614 to abandon the change. ON/OFF fields are toggled by pressing
<tt>enter
</tt>.
615 Advanced options can be displayed by hitting the
<tt>t
</tt> key.
617 <div class=
"ulist"><ul>
620 Set
<tt>CMAKE_BUILD_TYPE
</tt> to
<em>Release
</em> for an optimized build.
625 If CMake complains that it can
’t find MPI, and you don
’t want to install it, disable
626 <tt>FOAM_USE_MPI
</tt>. If, instead, you want to use GAMMA, enable
<tt>FOAM_USE_GAMMA
</tt>.
627 You can also enable more than one of the options.
629 <div class=
"admonitionblock">
632 <div class=
"title">Note
</div>
634 <td class=
"content">Currently only the MPI implementation is available.
</td>
640 Select the default Pstream implementation by setting
<tt>FOAM_DEFAULT_PSTREAM
</tt>
641 to one of
<em>dummy
</em>,
<em>mpi
</em> or
<em>gamma
</em>. This setting will only influence
642 the contents of the
<a href=
"#globalconfig">global
<em>controlDict
</em> file
</a>.
647 If CMake told you it couldn
’t find ParaView:
649 <div class=
"olist arabic"><ol class=
"arabic">
652 Set
<tt>ParaView_DIR
</tt> to the path of the directory containing
653 <em>ParaViewConfig.cmake
</em>, which is most likely the ParaView build directory.
658 If you do not want to build the ParaView plug-ins, disable
659 <tt>FOAM_BUILD_PARAVIEW_PLUGINS
</tt>
666 If you want to use the
<em>metis
</em> and
<em>parmetis
</em> decomposition methods, make
667 sure that
<tt>FOAM_ENABLE_METIS
</tt> and
<tt>FOAM_ENABLE_PARMETIS
</tt> are enabled,
668 respectively. If you do not have
<em>METIS
</em> or
<em>ParMetis
</em> installed, enable
669 <tt>FOAM_BUILD_PRIVATE_METIS
</tt> or
<tt>FOAM_BUILD_PRIVATE_PARMETIS
</tt>, respectively.
670 CMake will then try to download and build the selected libraries for you.
671 Conversely, if one of the libraries is provided by your system, you can
672 turn the respective setting to
<em>OFF
</em>. Please note that if your system
673 provides only
<em>ParMetis
</em>, you do not have to install
<em>METIS
</em>, as the former
674 also contains
<em>METIS
</em> in an older version.
679 If you want to use the
<em>MGridGen
</em> agglomeration method for the GAMG solver,
680 you need to enable
<tt>FOAM_ENABLE_MGRIDGEN
</tt> and if the library is not
681 installed on your system ensure that
<tt>FOAM_BUILD_PRIVATE_MGRIDGEN
</tt> is
682 enabled. See
<a href=
"#enable-mgridgen">above
</a> regarding the unknown license status
688 In order to build
<em>ccm26ToFoam
</em>, a conversion utility for grids generated
689 with
<em>ProStar/ccm
</em> © version
2.6, enable the setting
690 <tt>FOAM_ENABLE_CCMIO
</tt> and if
<em>libccmio
</em> is not installed on your system,
691 also
<tt>FOAM_BUILD_PRIVATE_CCMIO
</tt>. Refer to the
<a href=
"#enable-ccmio">above
</a>
692 description of the
<em>libccmio
</em> package for the license restrictions which
693 apply to this package. If you decide to build a private version, please
694 read the description of
<a href=
"#private-ccmio">+FOAM_BUILD_PRIVATE_CCMIO
</a>
700 If you plan on installing FreeFOAM, set
<tt>CMAKE_INSTALL_PREFIX
</tt> to the base directory
701 under which FreeFOAM should reside.
706 For more fine-grained control over what gets installed where, adjust
707 <tt>FOAM_INSTALL_CONFIG_PATH
</tt>,
<tt>FOAM_INSTALL_HEADER_PATH
</tt>,
<tt>FOAM_INSTALL_LIBRARY_PATH
</tt>,
708 <tt>FOAM_INSTALL_FRAMEWORK_PATH
</tt>,
<tt>FOAM_INSTALL_PV3FOAMREADER_PATH
</tt>,
709 <tt>FOAM_INSTALL_PVFOAMREADER_PATH
</tt> and
<tt>FOAM_INSTALL_USERDFOAM_PATH
</tt>. Paths not
710 starting with a slash (
<em>/
</em>) will be relative to
<em>CMAKE_INSTALL_PREFIX
</em>. If
711 you include a leading slash, the paths are absolute.
716 If you want FreeFOAM to use
<em>float
</em> as the floating point type instead of
717 <em>double
</em>, change
<tt>FOAM_DOUBLE_PRECISION
</tt> to
<em>OFF
</em>.
724 Hit
<tt>c
</tt> again. You shouldn
’t get any errors anymore now. Keep pressing
<tt>c
</tt>
725 until ccmake displays
"<tt>Press [g] to generate and exit</tt>" in the legend at
726 the bottom of the interface.
731 Press
<tt>g
</tt> to generate the Makefiles and exit the ccmake interface.
736 Start the native build tool. If you used the
<em>Makefile
</em> generator
737 (which is the default for Unix-platforms), type
739 <div class=
"listingblock">
740 <div class=
"content">
741 <pre><tt>$ make
</tt></pre>
746 If you have a multi-core/processor machine, you can speed things up
747 significantly by telling Make to run independent jobs in parallel.
748 A good choice for the number of parallel jobs to run is the
749 number of CPU
’s/cores you have in your machine plus
1 (to compensate
750 for disk-latency). For a typical dual-core machine, run
752 <div class=
"listingblock">
753 <div class=
"content">
754 <pre><tt>$ make -j3
</tt></pre>
759 <h2 id=
"_installing_freefoam">Installing FreeFOAM
</h2>
760 <div class=
"sectionbody">
761 <div class=
"paragraph"><p>If you want to, you can now install FreeFOAM. Depending on the
762 <tt>CMAKE_INSTALL_PREFIX
</tt> and the individual
<tt>FOAM_INSTALL_*_PATH
</tt> it is possible
763 that you have to do this as root, i.e. use
<tt>su
</tt> or
<tt>sudo
</tt>.
</p></div>
764 <div class=
"listingblock">
765 <div class=
"content">
766 <pre><tt>$ make install
</tt></pre>
769 <h2 id=
"_using_freefoam">Using FreeFOAM
</h2>
770 <div class=
"sectionbody">
771 <div class=
"paragraph"><p>If you didn
’t change
<tt>CMAKE_INSTALL_PREFIX
</tt> and
<tt>FOAM_INSTALL_BIN_PATH
</tt> chances
772 are that you can start using FreeFOAM right after you installed it without any
773 further steps being necessary.
</p></div>
774 <h3 id=
"globalconfig">Global Configuration Files
</h3><div style=
"clear:left"></div>
775 <div class=
"paragraph"><p>Unfortunately the OpenFOAM library (on which FreeFOAM builds) and some
776 applications require some files to be present for start-up. It finds those
777 in the following places (in the specified order, picking the first hit):
</p></div>
778 <div class=
"olist arabic"><ol class=
"arabic">
781 Under the directory specified in the
<tt>$FREEFOAM_CONFIG_DIR
</tt> environment
791 In
<em>$HOME/.FreeFOAM
</em>
796 In the installation directory of the configuration files. There are
797 two possible places for this:
799 <div class=
"dlist"><dl>
801 <em><CMAKE_INSTALL_PREFIX
>/
<FOAM_INSTALL_CONFIG_PATH
></em>
806 <tt><FOAM_INSTALL_CONFIG_PATH
></tt> as a relative path.
810 <em><FOAM_INSTALL_CONFIG_PATH
></em>
814 if you specified
<tt><FOAM_INSTALL_CONFIG_PATH
></tt> as
817 <div class=
"paragraph"><p></p></div>
822 <h3 id=
"_selecting_the_parallel_communications_library">Selecting the Parallel Communications Library
</h3><div style=
"clear:left"></div>
823 <div class=
"paragraph"><p>Both, FreeFOAM and OpenFOAM abstract the parallel operations into the
<em>Pstream
</em>
824 library, making it rather simple to firstly switch between parallel
825 implementations and secondly port the software to a new communications library.
826 However, FreeFOAM uses a much more flexible mechanism of determining which
827 <em>Pstream
</em> implementation library to use than OpenFOAM. The latter does this by
828 adjusting the
<tt>LD_LIBRARY_PATH
</tt> environment variable. As FreeFOAM wants to be a
829 well behaved Linux citizen, this is not an option. Instead, FreeFOAM dynamically
830 loads the desired
<em>Pstream
</em> library at startup (i.e. as a plug-in). The
831 following list details how FreeFOAM determines what library to load (if at all):
</p></div>
832 <div class=
"olist arabic"><ol class=
"arabic">
835 If the environment variable
<tt>FREEFOAM_PSTREAM_LIBRARY
</tt> is set,
836 FreeFOAM will try to load the library specified by it.
841 If the sub-dictionary
<tt>PstreamImplementation
</tt> exists in the global
842 <em>controlDict
</em> file (see
<a href=
"#globalconfig"><em>Global Configuration Files
</em></a>), it
843 reads the value of the entry
<tt>configName
</tt> therein. It then expects that a
844 sub-dictionary of
<tt>PstreamImplementation
</tt> with the name specified in
845 <tt>configName
</tt> exists. If that sub-dictionary contains the entry
<tt>library
</tt>, it
846 will try to load a library specified by the value of that entry.
850 <div class=
"paragraph"><p>After FreeFOAM (possibly) loaded the library, it will try to instantiate
851 concrete implementations of the abstract base classes
<tt>PstreamImpl
</tt>,
852 <tt>IPstreamImpl
</tt> and
<tt>OPstreamImpl
</tt>. Which classes are to be instantiated
853 is determined as follows:
</p></div>
854 <div class=
"olist arabic"><ol class=
"arabic">
857 FreeFOAM queries the environment variables
<tt>FREEFOAM_PSTREAM_CLASS
</tt>,
858 <tt>FREEFOAM_IPSTREAM_CLASS
</tt> and
<tt>FREEFOAM_OPSTREAM_CLASS
</tt> for the class
859 names to be instantiated.
864 For any of the variables not set, it requires the sub-dictionary
865 <tt>PstreamImplementation
</tt> to be present in the global
<em>controlDict
</em>, reads the
866 value of
<tt>configName
</tt> and similarly to the library loading, loads the
867 sub-dictionary specified by that value. It then expects to find the entries
868 <tt>Pstream
</tt>,
<tt>IPstream
</tt> and
<tt>OPstream
</tt> which specify the names of the classes
873 <div class=
"paragraph"><p>This means that one can create a global
<em>controlDict
</em> file containing
874 (among other things) something like the following:
</p></div>
875 <div class=
"exampleblock">
876 <div class=
"exampleblock-content">
877 <div class=
"listingblock">
878 <div class=
"content">
879 <pre><tt>PstreamImplementation
886 library libdummyPstream.so;
887 Pstream dummyPstreamImpl;
888 OPstream dummyOPstreamImpl;
889 IPstream dummyIPstreamImpl;
894 library libmpiPstream.so;
895 Pstream mpiPstreamImpl;
896 OPstream mpiOPstreamImpl;
897 IPstream mpiIPstreamImpl;
902 <div class=
"paragraph"><p>This way the administrator can provide a global
<em>controlDict
</em> in the FreeFOAM
903 installation. Every user can then override that
<em>controlDict
</em> by supplying her
904 own file in her home directory as detailed in
<a href=
"#globalconfig"><em>Global Configuration Files
</em></a>. In order to select a particular
<em>Pstream
</em> implementation
905 for a specific communications library, the user can then either adjust the
906 <tt>PstreamImplementation::configName
</tt> entry in the global
<em>controlDict
</em> file, set
907 the
<tt>FREEFOAM_PSTREAM_CONFIG
</tt> variable or for full control, set the variables
908 <tt>FREEFOAM_PSTREAM_LIBRARY
</tt>,
<tt>FREEFOAM_PSTREAM_CLASS
</tt>,
<tt>FREEFOAM_IPSTREAM_CLASS
</tt>
909 and
<tt>FREEFOAM_OPSTREAM_CLASS
</tt>.
</p></div>
910 <h3 id=
"_running_freefoam_from_the_build_tree">Running FreeFOAM From the Build Tree
</h3><div style=
"clear:left"></div>
911 <div class=
"paragraph"><p>You can use FreeFOAM without installing it first, directly from the build tree.
912 However, this might take a little bit more effort to set up because most likely
913 you will have to adjust the following environment variables:
</p></div>
914 <div class=
"dlist"><dl>
937 <div class=
"paragraph"><p>Where it is assumed that you followed the
<a href=
"#installation">installation instructions
</a>. If
938 you used different paths for downloading and compiling FreeFOAM, you will have
939 to adjust these names. Refer to
<a href=
"#environment"><em>Extending Search Paths And Setting Environment Variables Permanently
</em></a> if you need help setting these
942 <h2 id=
"_running_the_tutorials">Running the tutorials
</h2>
943 <div class=
"sectionbody">
944 <div class=
"paragraph"><p>Now you should be able to run the tutorial cases. For this copy the
<tt>tutorials
</tt>
945 directory to some convenient place:
</p></div>
946 <div class=
"listingblock">
947 <div class=
"content">
948 <pre><tt>$ mkdir -p $HOME/FreeFOAM/$LOGNAME-{shortver}/run
949 $ cp -r $HOME/Source/freefoam-{fullver}-build/tutorials $HOME/FreeFOAM/$LOGNAME-{shortver}/run/
950 $ cd $HOME/FreeFOAM/$LOGNAME-{shortver}/run/tutorials
</tt></pre>
952 <div class=
"paragraph"><p>And try to run e.g. the
<em>cavity
</em> tutorial case:
</p></div>
953 <div class=
"listingblock">
954 <div class=
"content">
955 <pre><tt>$ cd icoFoam
956 $ freefoam blockMesh -case cavity
957 $ freefoam checkMesh -case cavity
958 $ freefoam ico -case cavity
</tt></pre>
960 <div class=
"paragraph"><p>Things should run smoothly and finish without an error.
</p></div>
961 <div class=
"paragraph"><p>All the tutorials contain a script for automatic execution since some of the
962 cases are quite intricate and it is not obvious how to run them. Also, these
963 scripts are used for automated testing. The scripts are called
<em>Allrun
</em>, where
964 the one located in the
<em>tutorials
</em> directory is a driver script to run all the
965 other tutorials.
</p></div>
967 <h2 id=
"_obtaining_the_source_code_from_the_git_repository">Obtaining the Source Code from the GIT repository
</h2>
968 <div class=
"sectionbody">
969 <div class=
"ulist"><ul>
972 Clone the FreeFOAM repository (here the clone is placed in
973 <tt>$HOME/Source/FreeFOAM
</tt>):
975 <div class=
"listingblock">
976 <div class=
"content">
977 <pre><tt>$ mkdir -p $HOME/Source
978 $ git clone git://repo.or.cz/freefoam.git $HOME/Source/FreeFOAM
</tt></pre>
983 Proceed in the same way (replacing the path names apropriately) as in the
984 above build instructions.
989 <h2 id=
"_shell_completion_scripts">Shell completion scripts
</h2>
990 <div class=
"sectionbody">
991 <div class=
"paragraph"><p>FreeFOAM comes with completions scripts for the
992 <a href=
"http://www.gnu.org/software/bash/">BASH
</a> and
<a href=
"http://www.zsh.org/">ZSH
</a> shells.
993 The former is quite simplistic and only offers very basic completion of the
994 available application names. The ZSH completion, however, is quite complete and
995 also completes options and arguments for all applications. These completion
996 functions are not installed by
<tt>make install
</tt>, because no two systems have the
997 same locations for these kinds of scripts. You find them for manual
998 installation in the FreeFOAM sources in the directory
999 <em>data/shellFunctions/bashCompletion
</em> and
<em>data/shellFunctions/zshCompletion
</em>
1000 respectively. Please refer to the documentation of your system/shell on where
1001 to place them.
</p></div>
1003 <h2 id=
"_emacs_mode">Emacs mode
</h2>
1004 <div class=
"sectionbody">
1005 <div class=
"paragraph"><p>FreeFOAM includes a rudimentary major mode for the
1006 <a href=
"http://www.gnu.org/software/emacs">Emacs
</a> programming editor. If you want to use
1007 this mode, place the file
<em>data/editor-modes/foamdict-mode.el
</em> in a directory
1008 where your Emacs installation finds it. Please refer to the Emacs documentation
1009 for further instructions.
</p></div>
1011 <h2 id=
"_build_configuration_reference">Build Configuration Reference
</h2>
1012 <div class=
"sectionbody">
1013 <div class=
"dlist glossary"><dl>
1015 <tt>CMAKE_BUILD_TYPE
</tt>
1019 One of
<em><empty
></em>,
<em>Debug
</em>,
<em>Release
</em>,
<em>RelWithDebInfo
</em> and
<em>MinSizeRel
</em>.
1020 Refer to the CMake documentation for more detail.
1024 <tt>FOAM_DOUBLE_PRECISION
</tt>
1028 If set to
<em>ON
</em> FreeFOAM will be compiled using
<em>double
</em> as the
1029 floating point type. If set to
<em>OFF
</em> it will use
<em>float
</em>.
1033 <tt>FOAM_BUILD_FRAMEWORKS
</tt>
1037 If this is enabled, the libraries are built as frameworks. Only available on
1042 <tt>FOAM_EXE_PREFIX
</tt>
1046 Prefix used to mangle application names. Normally this shouldn
’t be changed.
1050 <tt>CMAKE_INSTALL_PREFIX
</tt>
1054 Installation prefix under which to install FreeFOAM.
1058 <tt>FOAM_INSTALL_BIN_PATH
</tt>
1062 Installation path of the binaries. If not absolute, it is relative to
1063 <em>CMAKE_INSTALL_PREFIX
</em>.
1067 <tt>FOAM_INSTALL_LIBEXEC_PATH
</tt>
1071 Installation path of the binaries which should not be on the
<tt>PATH
</tt>. If not
1072 absolute, it is relative to
<tt>CMAKE_INSTALL_PREFIX
</tt>.
1076 <tt>FOAM_INSTALL_CONFIG_PATH
</tt>
1080 Installation path of the configuration files. If not absolute, it is
1081 relative to
<em>CMAKE_INSTALL_PREFIX
</em>.
1085 <tt>FOAM_INSTALL_HEADER_PATH
</tt>
1089 Installation path of the header files. If not absolute, it is
1090 relative to
<em>CMAKE_INSTALL_PREFIX
</em>. On Mac OS X, and if
1091 <em>FOAM_BUILD_FRAMEWORKS
</em> is enabled, this setting is ignored.
1095 <tt>FOAM_INSTALL_LIBRARY_PATH
</tt>
1099 Installation path of the libraries. If not absolute, it is
1100 relative to
<em>CMAKE_INSTALL_PREFIX
</em>.
1104 <tt>FOAM_INSTALL_FRAMEWORK_PATH
</tt>
1108 Installation path of the Mac OS X frameworks. If not absolute, it is
1109 relative to
<em>CMAKE_INSTALL_PREFIX
</em>. This is only available and takes
1110 effect if FreeFOAM is compiled on Mac OS X, and if
1111 <em>FOAM_BUILD_FRAMEWORKS
</em> is enabled.
1115 <tt>FOAM_INSTALL_PV3FOAMREADER_PATH
</tt>
1119 Installation path of the ParaView3 plug-ins. If not absolute, it is
1120 relative to
<em>CMAKE_INSTALL_PREFIX
</em>.
1124 <tt>FOAM_INSTALL_PVFOAMREADER_PATH
</tt>
1128 Installation path of the ParaView2 plug-ins. If not absolute, it is
1129 relative to
<em>CMAKE_INSTALL_PREFIX
</em>.
1133 <tt>FOAM_INSTALL_USERDFOAM_PATH
</tt>
1137 Installation path of the Ensight plug-in. If not absolute, it is
1138 relative to
<em>CMAKE_INSTALL_PREFIX
</em>.
1142 <tt>FOAM_USE_GAMMA
</tt>
1146 If enabled, FreeFOAM will use the GAMMA parallel communications library.
1147 This is currently not implemented.
1151 <tt>FOAM_USE_MPI
</tt>
1155 If enabled, FreeFOAM will use the MPI parallel communications library.
1156 This is required in order to build some of the libraries and utilities.
1160 <tt>FOAM_DEFAULT_PSTREAM
</tt>
1164 The default Pstream selection in the global
<em>controlDict
</em> file.
1168 <tt>FOAM_BUILD_PARAVIEW_PLUGINS
</tt>
1172 Whether to build the ParaView plug-ins. If enabled, FreeFOAM requires a
1173 ParaView build tree and the
<em>ParaView_DIR
</em> variable set to the path of it.
1177 <tt>FOAM_ENABLE_CCMIO
</tt>
1181 Enable the use of
<em>libccmio
</em>. This is required to build the grid conversion
1182 utility
<em>ccm26ToFoam
</em>.
1184 <div class=
"admonitionblock" id=
"enable-ccmio">
1187 <div class=
"title">Warning
</div>
1189 <td class=
"content">The license of
<em>libccmio
</em> © is proprietary and requires the consent of the
1190 copyright holders (
<a href=
"http://www.cd-adapco.com">CD-adapco
</a>) to download and use the
1191 library. Further it is not allowed to redistribute it in any form. The request
1192 for permission of inclusion with
<a href=
"http://debian.org">Debian
</a> was answered as
1193 follows by
<a href=
"mailto:geoffrey.prewett@us.cd-adapco.com">Geoffrey Prewett
</a>:
</td>
1196 <div class=
"listingblock">
1197 <div class=
"content">
1200 Sorry for the delay in response. I checked back with our development director,
1201 and he felt that it would be best to not include libccmio with Debian.
1202 Instead, we would prefer to continue our current policy and keep it on our
1203 web/FTP and have people ask for it. There are three reasons for this:
1205 1) We don't support STAR on Debian, and don't want to give the impression that we do.
1206 2) We would like to keep a list of people that we give the library to.
1207 3) This is not a general purpose library; its sole purpose is to communicate
1208 between our products. Accepting outside changes risks committing a change that
1209 would break our own software in possibly subtle ways.
1211 So I regret to tell you that my company has declined to permit libccmio to be
1212 distributed as part of Debian.
1215 Geoff Prewett
</tt></pre>
1219 <tt>FOAM_BUILD_PRIVATE_CCMIO
</tt>
1223 Automatically download and build libccmio. Unfortunately this process may
1224 fail in the download step if CMake cannot find either
<em>wget
</em> or
<em>curl
</em> on
1225 your system, since CMake itself currently does not support
<em>https
</em> URLs. If
1226 this happens, the build process will abort. To fix the issue, Download the
1227 file
<a href=
"https://wci.llnl.gov/codes/visit/3rd_party/libccmio-2.6.1.tar.gz">https://wci.llnl.gov/codes/visit/
3rd_party/libccmio-
2.6.1.tar.gz
</a>
1228 manually and place it in
<tt>ThirdParty/ccmio/src
</tt> (relative to the build
1229 directory). It is important that you re-run CMake
<strong>before
</strong> restarting the
1230 build in order to notify the build system that the file is now there.
1234 <tt>FOAM_ENABLE_METIS
</tt>
1238 Enable the use of the
<em>METIS
</em> graph partitioning library which is required to
1239 implement the
<em>metis
</em> decomposition method.
1243 <tt>FOAM_BUILD_PRIVATE_METIS
</tt>
1247 Automatically download and build
<em>METIS
</em>.
1251 <tt>FOAM_BUILD_PRIVATE_PARMETIS
</tt>
1255 Automatically download and build
<em>ParMetis
</em>.
1259 <tt>FOAM_ENABLE_MGRIDGEN
</tt>
1263 Enable the use of
<em>MGRIDGEN
</em> which is required to build
1264 <em>MGridGenGamgAgglomeration
</em> providing the
<em>MGridGen
</em> agglomeration method for
1267 <div class=
"admonitionblock" id=
"enable-mgridgen">
1270 <div class=
"title">Warning
</div>
1272 <td class=
"content">The license of
<em>MGRIDGEN
</em> is unknown and the upstream authors so far have not
1273 answered any inquiries to resolve the issue. If you enable the use of
1274 <em>MGRIDGEN
</em> you alone are responsible for ensuring that you don
’t violate any
1275 license conditions applying to these libraries. The authors of FreeFOAM will
1276 and cannot take any responsibility for your actions.
</td>
1281 <tt>FOAM_BUILD_PRIVATE_MGRIDGEN
</tt>
1285 Automatically download and build
<em>MGRIDGEN
</em>.
1289 <tt>FOAM_ENABLE_DOXYGEN_DOCS
</tt>
1293 Enable building of the
<em>Doxygen API documentation
</em>. The documentation will
1294 only be built once and is not updated automatically. This is because it
1295 depends on a huge number of files and would make dependency tracking very
1296 slow and difficult to maintain. To force the re-generation of the API
1297 documentation execute
<tt>make apidoc
</tt>.
1301 <tt>FOAM_DOXYDOCS_FOR_SF
</tt>
1305 This setting is for the maintainers of the FreeFOAM and indicates whether the
1306 Doxygen documentation should be built for deployment on
1307 <a href=
"http://freefoam.sourceforge.net">http://freefoam.sourceforge.net
</a>.
1311 <tt>FOAM_ENABLE_MANPAGE_HELP
</tt>
1315 <a id=
"foam_enable_manpage_help"></a>
1316 Build (and install) the help-pages in manpage format. This requires a
1317 complete
<a href=
"http://www.methods.co.nz/asciidoc">Asciidoc
</a> toolchain to be present.
1321 <tt>FOAM_ENABLE_XHMTL_HELP
</tt>
1325 Build (and install) the help-pages in xhtml format for the display in a web
1326 browser. The requirements are the same as for
1327 <a href=
"#foam_enable_manpage_help"><tt>FOAM_ENABLE_MANPAGE_HELP
</tt></a>.
1331 <tt>FOAM_USE_LOCAL_DOXYGEN_DOCS
</tt>
1335 This setting influences the location in which the Doxygen source
1336 code documentation is looked for if any of the FreeFOAM applications
1337 is invoked with the
<em>-doc
</em> or
<em>-srcDoc
</em> options. If it is disabled,
1338 the documentation will be loaded over the network from
1339 <a href=
"http://freefoam.sf.net/doc/Doxygen/html">http://freefoam.sf.net/doc/Doxygen/html
</a>. If you enable it, the
1340 documentation will be loaded locally. This requires that you either
1341 build and install the documentation by enabling
<tt>FOAM_ENABLE_DOXYGEN_DOCS
</tt>,
1342 or provide the required HTML files otherwise.
1346 <tt>HTML_DOC_BROWSER
</tt>
1350 This is the program used to display the Doxygen source code documentation
1351 if any of the FreeFOAM applications is invoked with the
<em>-doc
</em> or
<em>-srcDoc
</em>
1352 options. The special value of
<em>ECHO
</em> changes the behaviour to just write
1353 the location of the HTML file to the output. This is a good setting if
1354 you
’re system doesn
’t have any kind of HTML browser installed (such
1359 <tt>FOAM_HTML_DOC_BROWSER_COMMAND
</tt>
1363 This is the command with which to invoke the HTML browser. By default
1364 it calls the program named in
<tt>HTML_DOC_BROWSER
</tt> and passes it the
1365 name/URL of the documentation file to be displayed. You shouldn
’t
1366 have to change this unless your HTML browser requires some unusual
1367 options or arguments.
1372 <h2 id=
"_troubleshooting">Troubleshooting
</h2>
1373 <div class=
"sectionbody">
1374 <h3 id=
"_the_freefoam_executables_are_not_found_by_the_shell">The FreeFOAM Executables Are Not Found By The Shell
</h3><div style=
"clear:left"></div>
1375 <div class=
"paragraph"><p>There are three possible reasons for this:
</p></div>
1376 <div class=
"olist arabic"><ol class=
"arabic">
1379 Your shell (notably
<em>csh
</em>,
<em>tcsh
</em> and
<em>zsh
</em>) requires you to refresh the
1380 cache of available executables. You can do so by entering the command:
1382 <div class=
"listingblock">
1383 <div class=
"content">
1384 <pre><tt>$ rehash
</tt></pre>
1389 If
<em>rehashing
</em> didn
’t solve the problem, the problem most likely is that you
1390 installed FreeFOAM into a non-standard location by changing the configuration
1391 variables
<tt>CMAKE_INSTALL_PREFIX
</tt> or
<tt>FOAM_INSTALL_BIN_PATH
</tt> in which case the
1392 executables where installed into a directory not searched by the shell. In
1393 this case you have to add the installation directory of the executables to
1394 the
<tt>PATH
</tt> variable. There are two possible locations:
1396 <div class=
"dlist"><dl>
1397 <dt class=
"hdlist1">
1398 <em><CMAKE_INSTALL_PREFIX
>/
<FOAM_INSTALL_BIN_PATH
></em>
1403 <tt>FOAM_INSTALL_BIN_PATH
</tt> as a relative path
1406 <dt class=
"hdlist1">
1407 <em><FOAM_INSTALL_BIN_PATH
></em>
1411 if you specified
<tt>FOAM_INSTALL_BIN_PATH
</tt> as an absolute
1416 <div class=
"paragraph"><p>After extending the
<tt>PATH
</tt> variable with the installation directory of the
1417 executables, you should be able to run all FreeFOAM applications as any other
1418 binary available on the system. See
<a href=
"#environment"><em>Extending Search Paths And Setting Environment Variables Permanently
</em></a> for
1419 instructions on how to extend the search path.
</p></div>
1423 This option is similar to the previous solution and applies if you want to
1424 run FreeFOAM from the build tree (i.e. without running
<tt>make install
</tt>). In
1425 this case you again have to make sure that your shell finds the executables
1426 built by CMake by extending the
<tt>PATH
</tt> variable. Further, you have to tell
1427 FreeFOAM where to find the global configuration files (see
1428 <a href=
"#globalconfig"><em>Global Configuration Files
</em></a>). Here, you have the option to
1429 place the files under your home directory or set an environment variable. The
1430 former can be achieved by:
1432 <div class=
"listingblock">
1433 <div class=
"content">
1434 <pre><tt>$ mkdir -p $HOME/.FreeFOAM/{shortver}
1435 $ cp $HOME/Source/freefoam-{fullver}-build/etc/controlDict $HOME/.FreeFOAM/{shortver}
1436 $ cp $HOME/Source/freefoam-{fullver}-build/etc/cellModels $HOME/.FreeFOAM/{shortver}
1437 $ cp -r $HOME/Source/freefoam-{fullver}-build/etc/thermoData $HOME/.FreeFOAM/{shortver}
</tt></pre>
1439 <div class=
"paragraph"><p>The latter (and recommended) method is to set the environment variable
1440 build tree to your actual setup.
</p></div>
1443 <h3 id=
"_starting_any_freefoam_application_fails_because_some_libraries_cannot_be_found">Starting Any FreeFOAM Application Fails Because Some Libraries Cannot Be Found
</h3><div style=
"clear:left"></div>
1444 <div class=
"paragraph"><p>Although CMake should have taken care of this by using
<tt>RPATH
</tt> on Linux and
1445 <tt>install_name
</tt> on Mac OS X, it might be necessary on some systems to adjust the
1446 library search paths:
</p></div>
1447 <div class=
"dlist"><dl>
1448 <dt class=
"hdlist1">
1449 <tt>LD_LIBRARY_PATH
</tt>
1453 This variable is used by all Unix like systems (e.g. Linux,
1457 <dt class=
"hdlist1">
1458 <tt>DYLD_LIBRARY_PATH
</tt>
1462 This variable is used by Mac OS X.
1466 <div class=
"paragraph"><p>If you installed FreeFOAM, there are (as with the executables), two possible
1467 installation directories:
</p></div>
1468 <div class=
"dlist"><dl>
1469 <dt class=
"hdlist1">
1470 <em><CMAKE_INSTALL_PREFIX
>/
<FOAM_INSTALL_LIBRARY_PATH
></em>
1475 <tt>FOAM_INSTALL_LIBRARY_PATH
</tt> as a relative path.
1478 <dt class=
"hdlist1">
1479 <em><FOAM_INSTALL_LIBRARY_PATH
></em>
1483 if you specified
<tt>FOAM_INSTALL_LIBRARY_PATH
</tt> as an absolute
1488 <div class=
"paragraph"><p>If you are trying to run from the build tree, you have to include
1489 paths (where you have to adjust the location of the build tree to your actual
1491 <h3 id=
"_a_running_freefoam_application_aborts_because_it_can_8217_t_em_dlopen_em_a_library">A Running FreeFOAM Application Aborts Because It Can
’t
<em>dlopen
</em> A Library
</h3><div style=
"clear:left"></div>
1492 <div class=
"paragraph"><p>FreeFOAM (and OpenFOAM) often dynamically load libraries at run-time (a.k.a
1493 plug-ins) to add features the user requested without requiring that the whole
1494 application be recompiled. This makes it very simple to add new boundary
1495 conditions, turbulence and combustion models etc. However, it also requires that
1496 FreeFOAM must be able to find these libraries at run-time. The operating system
1497 function which does the loading of the libraries (
<em>dlopen
</em>) usually tries to
1498 find the library with the given name in several places; namely a default search
1499 path and a search path configured by one or multiple environment variables such
1500 as
<tt>LD_LIBRARY_PATH
</tt> or
<tt>DYLD_LIBRARY_PATH
</tt> (on Mac OS X). The details vary from
1501 platform to platform, so you best consult the documentation of
<em>dlopen
</em> for the
1503 <div class=
"paragraph"><p>Additionally FreeFOAM allows you to configure a custom search path for plug-ins
1504 in the
<a href=
"#globalconfig">global
<em>controlDict
</em></a> file by listing the directories to
1505 be searched in the list
<tt>LibrarySearchPaths
</tt>. By default FreeFOAM is configured
1506 to search for plug-ins in the location where CMake installed them.
</p></div>
1507 <div class=
"paragraph"><p>If you want to add your own plug-in libraries (e.g. you want to add your own
1508 boundary conditions class), you most probably will want to extend this search
1510 <h3 id=
"_freefoam_aborts_when_trying_to_instantiate_a_plugin_class">FreeFOAM Aborts When Trying To Instantiate a Plugin Class
</h3><div style=
"clear:left"></div>
1511 <div class=
"paragraph"><p>If you get a warning message similar to the following
</p></div>
1512 <div class=
"literalblock">
1513 <div class=
"content">
1514 <pre><tt>--
> FOAM Warning :
1515 From function dlLibraryTable::open(const dictionary
& dict, const word
& libsEntry, const TablePtr tablePtr)
1516 in file XXX/src/OpenFOAM/db/dlLibraryTable/dlLibraryTableTemplates.C at line
68
1517 library
"libfieldFunctionObjects.so" did not introduce any new entries
</tt></pre>
1519 <div class=
"paragraph"><p>(where
<tt>XXX
</tt> is the path to the FreeFOAM source code and the actual library
1520 name can be different), followed by a fatal error stating that FreeFOAM does
1521 not know a class or type, e.g.
</p></div>
1522 <div class=
"literalblock">
1523 <div class=
"content">
1524 <pre><tt>--
> FOAM FATAL ERROR:
1525 Unknown function type fieldAverage
</tt></pre>
1527 <div class=
"literalblock">
1528 <div class=
"content">
1529 <pre><tt>Table of functionObjects is empty
</tt></pre>
1531 <div class=
"literalblock">
1532 <div class=
"content">
1533 <pre><tt>From function functionObject::New(const word
& name, const Time
&, const dictionary
&)
1534 in file XXX/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C at line
74.
</tt></pre>
1536 <div class=
"literalblock">
1537 <div class=
"content">
1538 <pre><tt>FOAM exiting
</tt></pre>
1540 <div class=
"paragraph"><p>and you are absolutely sure that the named type actually exists in the library
1541 mentioned in the preceding warning message, the issue is very likely that
1542 FreeFOAM is loading the plugin library from a different binary tree than the
1543 executable belongs to.
</p></div>
1544 <div class=
"admonitionblock">
1547 <div class=
"title">Important
</div>
1549 <td class=
"content">Always make sure that you never load plugins from different binary trees (where
1550 the build tree and the install tree count as such). If you want to run a binary
1551 from the build tree but already have a corresponding installation tree, use the
1552 <tt>FREEFOAM_CONFIG_DIR
</tt> environment variable to point FreeFOAM to the directory
1553 <em><path to build tree
>/etc/
</em> containing the global
<em>controlDict
</em> file in the
1554 <strong>build tree
</strong>.
</td>
1558 <h2 id=
"environment">Extending Search Paths And Setting Environment Variables Permanently
</h2>
1559 <div class=
"sectionbody">
1560 <div class=
"paragraph"><p>The way one sets environment variables and extends the executable and library
1561 search paths permanently strongly depends on the shell used. Usually one has to
1562 create or change an initialization file in the users home directory. In the
1563 following this will be discussed very briefly for the popular shells
<em>BASH
</em> and
1564 <em>tcsh
</em>. However, if you need more help or want information on using the shell,
1565 there is an excellent tutorial available at
<a href=
"http://linuxcommand.org">http://linuxcommand.org
</a>.
</p></div>
1566 <h3 id=
"_bash">BASH
</h3><div style=
"clear:left"></div>
1567 <div class=
"paragraph"><p>The BASH shell is the default shell for most Linux/Unix distributions. Most
1568 systems configure the BASH shell such that it reads the text file
1569 <em>$HOME/.bashrc
</em> when starting up, so this is the place where one appends
1570 customizations of the environment variables. On some systems this file is not
1571 processed by default (notably Mac OS X). In this case you can use
1572 <em>$HOME/.bash_profile
</em>.
</p></div>
1573 <h4 id=
"_referencing_a_variable">Referencing A Variable
</h4>
1574 <div class=
"paragraph"><p>To retrieve the value stored in a shell variable or environment variable, one
1575 prefixes its name with the dollar (
<tt>$
</tt>) character.
</p></div>
1576 <h4 id=
"_setting_a_variable">Setting A Variable
</h4>
1577 <div class=
"paragraph"><p>The syntax for setting a variable and making it available to child-processes of
1578 the shell is the following:
</p></div>
1579 <div class=
"listingblock">
1580 <div class=
"content">
1581 <pre><tt>$ export variable_name=variable_value
</tt></pre>
1583 <div class=
"paragraph"><p>Note that no white-space characters are allowed surrounding the
<tt>=
</tt> sign.
</p></div>
1584 <h4 id=
"_extending_a_search_path">Extending A Search Path
</h4>
1585 <div class=
"paragraph"><p>The shell and other Unix system facilities use environment variables to locate
1586 executables and dynamically linked libraries. These search paths consist of
1587 strings naming directories in which the executables and libraries should be
1588 searched for. The individual paths are separated by a colon (
<tt>:
</tt>) character. To
1589 add the e.g. the directory
<em>$HOME/bin
</em> to the search path for executables, one
1590 would do the following:
</p></div>
1591 <div class=
"listingblock">
1592 <div class=
"content">
1593 <pre><tt>$ export PATH=$PATH:$HOME/bin
</tt></pre>
1595 <div class=
"paragraph"><p>which appends
<em>$HOME/bin
</em> to the end of the
<tt>PATH
</tt> variable.
</p></div>
1596 <h3 id=
"_tcsh">TCSH
</h3><div style=
"clear:left"></div>
1597 <div class=
"paragraph"><p>Some users and administrators prefer to use a
<em>C-Shell
</em>, such as the TCSH. Here
1598 you can use e.g. the file
<em>$HOME/.tcshrc
</em> to customize the environment.
</p></div>
1599 <h4 id=
"_referencing_a_variable_2">Referencing A Variable
</h4>
1600 <div class=
"paragraph"><p>As with the BASH, one retrieves the value stored in a shell variable or
1601 environment variable by prefixing its name with the dollar (
<tt>$
</tt>) character.
1602 Sometimes it is also necessary to protect the variable name by surrounding it
1603 with curly braces (
<tt>{
</tt> and
<tt>}
</tt>).
</p></div>
1604 <h4 id=
"_setting_a_variable_2">Setting A Variable
</h4>
1605 <div class=
"paragraph"><p>The syntax for setting a variable and making it available to child-processes of
1606 the shell is the following:
</p></div>
1607 <div class=
"listingblock">
1608 <div class=
"content">
1609 <pre><tt>$ setenv variable_name variable_value
</tt></pre>
1611 <h4 id=
"_extending_a_search_path_2">Extending A Search Path
</h4>
1612 <div class=
"paragraph"><p>The shell and other Unix system facilities use environment variables to locate
1613 executables and dynamically linked libraries. These search paths consist of
1614 strings naming directories in which the executables and libraries should be
1615 searched for. The individual paths are separated by a colon (
<tt>:
</tt>) character. To
1616 add the e.g. the directory
<em>$HOME/bin
</em> to the search path for executables, one
1617 would do the following:
</p></div>
1618 <div class=
"listingblock">
1619 <div class=
"content">
1620 <pre><tt>$ setenv PATH ${PATH}:${HOME}/bin
</tt></pre>
1622 <div class=
"paragraph"><p>which appends
<em>$HOME/bin
</em> to the end of the
<tt>PATH
</tt> variable. Note that
1623 <em>C-shells
</em> usually require the user to type
<em>rehash
</em> after changing the
<tt>PATH
</tt>
1624 variable to update the cache of available programs.
</p></div>
1627 <div id=
"footnotes"><hr /></div>
1629 <div id=
"footer-text">
1630 Last updated
2010-
08-
01 18:
48:
36 CEST