Add the OpenFOAM source tree
This commit is contained in:
246
etc/bashrc
Normal file
246
etc/bashrc
Normal file
@ -0,0 +1,246 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/bashrc
|
||||
#
|
||||
# Description
|
||||
# Startup file for OpenFOAM
|
||||
# Sourced from ~/.profile or ~/.bashrc
|
||||
# Should be usable by any POSIX-compliant shell (eg, ksh)
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
export WM_PROJECT=OpenFOAM
|
||||
export WM_PROJECT_VERSION=dev
|
||||
|
||||
################################################################################
|
||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||
#
|
||||
# either set $FOAM_INST_DIR before sourcing this file or set
|
||||
# 'foamInstall' below to where OpenFOAM is installed
|
||||
#
|
||||
# Location of the OpenFOAM installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
foamInstall=$HOME/$WM_PROJECT
|
||||
# foamInstall=~$WM_PROJECT
|
||||
# foamInstall=/opt/$WM_PROJECT
|
||||
# foamInstall=/usr/local/$WM_PROJECT
|
||||
#
|
||||
# END OF (NORMAL) USER EDITABLE PART
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# These are the defaults for this version which should generally be
|
||||
# overridden from the prefs.sh file or from command-line specification
|
||||
#
|
||||
#- note the location for later use (eg, in job scripts)
|
||||
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
|
||||
|
||||
#- Compiler location:
|
||||
# foamCompiler= system | ThirdParty (OpenFOAM)
|
||||
foamCompiler=system
|
||||
|
||||
#- Compiler:
|
||||
# WM_COMPILER = Gcc | Gcc45 | Gcc46 | Gcc47 | Clang | Icc (Intel icc)
|
||||
export WM_COMPILER=Gcc
|
||||
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
|
||||
|
||||
#- Architecture:
|
||||
# WM_ARCH_OPTION = 32 | 64
|
||||
export WM_ARCH_OPTION=64
|
||||
|
||||
#- Precision:
|
||||
# WM_PRECISION_OPTION = DP | SP
|
||||
export WM_PRECISION_OPTION=DP
|
||||
|
||||
#- Optimised, debug, profiling:
|
||||
# WM_COMPILE_OPTION = Opt | Debug | Prof
|
||||
export WM_COMPILE_OPTION=Opt
|
||||
|
||||
#- MPI implementation:
|
||||
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
|
||||
# | GAMMA | MPI | QSMPI | SGIMPI
|
||||
export WM_MPLIB=SYSTEMOPENMPI
|
||||
|
||||
#- Operating System:
|
||||
# WM_OSTYPE = POSIX | ???
|
||||
export WM_OSTYPE=POSIX
|
||||
|
||||
#- Floating-point signal handling:
|
||||
# set or unset
|
||||
export FOAM_SIGFPE=
|
||||
|
||||
#- memory initialisation:
|
||||
# set or unset
|
||||
#export FOAM_SETNAN=
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
# The old dirs to be cleaned from the various environment variables
|
||||
# - remove anything under top-level directory.
|
||||
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
|
||||
foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $HOME/$WM_PROJECT/$USER"
|
||||
if [ "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ]
|
||||
then
|
||||
foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
|
||||
fi
|
||||
|
||||
|
||||
# Location of installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
|
||||
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of third-party software
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of site-specific templates etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
||||
if [ -d "$WM_PROJECT_SITE" ]
|
||||
then
|
||||
export WM_PROJECT_SITE
|
||||
else
|
||||
unset WM_PROJECT_SITE
|
||||
fi
|
||||
|
||||
# Location of user files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
|
||||
|
||||
|
||||
# Source files, possibly with some verbosity
|
||||
_foamSource()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" 1>&2
|
||||
. $1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# Evaluate command-line parameters
|
||||
_foamEval()
|
||||
{
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-*)
|
||||
# stray option (not meant for us here) -> get out
|
||||
break
|
||||
;;
|
||||
*=)
|
||||
# name= -> unset name
|
||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "unset ${1%=}" 1>&2
|
||||
eval "unset ${1%=}"
|
||||
;;
|
||||
*=*)
|
||||
# name=value -> export name=value
|
||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1" 1>&2
|
||||
eval "export $1"
|
||||
;;
|
||||
*)
|
||||
# filename: source it
|
||||
if [ -f "$1" ]
|
||||
then
|
||||
_foamSource "$1"
|
||||
else
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# Add in preset user or site preferences:
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
|
||||
|
||||
# Evaluate command-line parameters and record settings for later
|
||||
# these can be used to set/unset values, or specify alternative pref files
|
||||
export FOAM_SETTINGS="$@"
|
||||
_foamEval $@
|
||||
|
||||
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
||||
|
||||
#- Clean PATH
|
||||
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
|
||||
|
||||
#- Clean LD_LIBRARY_PATH
|
||||
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
|
||||
&& LD_LIBRARY_PATH="$cleaned"
|
||||
|
||||
#- Clean MANPATH
|
||||
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
|
||||
|
||||
export PATH LD_LIBRARY_PATH MANPATH
|
||||
|
||||
|
||||
# Source project setup files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamSource $WM_PROJECT_DIR/etc/config/settings.sh
|
||||
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh
|
||||
|
||||
|
||||
# Source user setup files for optional packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/gperftools.sh`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.sh`
|
||||
|
||||
|
||||
# Clean environment paths again. Only remove duplicates
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#- Clean PATH
|
||||
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"
|
||||
|
||||
#- Clean LD_LIBRARY_PATH
|
||||
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"
|
||||
|
||||
#- Clean MANPATH (trailing ':' to find system pages)
|
||||
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"
|
||||
|
||||
export PATH LD_LIBRARY_PATH MANPATH
|
||||
|
||||
#- Clean LD_PRELOAD
|
||||
if [ -n "$LD_PRELOAD" ]
|
||||
then
|
||||
cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
|
||||
export LD_PRELOAD
|
||||
fi
|
||||
|
||||
|
||||
# cleanup environment:
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
unset cleaned foamClean foamInstall foamOldDirs
|
||||
unset _foamSource _foamEval
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
140
etc/caseDicts/foamyHexMeshDict
Normal file
140
etc/caseDicts/foamyHexMeshDict
Normal file
@ -0,0 +1,140 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object foamyHexMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#inputMode merge;
|
||||
|
||||
surfaceConformation
|
||||
{
|
||||
pointPairDistanceCoeff 0.1;
|
||||
mixedFeaturePointPPDistanceCoeff 5.0;
|
||||
featurePointExclusionDistanceCoeff 0.65;
|
||||
featureEdgeExclusionDistanceCoeff 0.65;
|
||||
surfaceSearchDistanceCoeff 5;
|
||||
maxSurfaceProtrusionCoeff 0.1;
|
||||
maxQuadAngle 125;
|
||||
surfaceConformationRebuildFrequency 10;
|
||||
|
||||
featurePointControls
|
||||
{
|
||||
specialiseFeaturePoints on;
|
||||
edgeAiming on;
|
||||
guardFeaturePoints off;
|
||||
snapFeaturePoints off;
|
||||
circulateEdges off;
|
||||
}
|
||||
|
||||
conformationControls
|
||||
{
|
||||
edgeSearchDistCoeff 5;
|
||||
surfacePtReplaceDistCoeff 0.5;
|
||||
surfacePtExclusionDistanceCoeff 0.5;
|
||||
maxIterations 15;
|
||||
iterationToInitialHitRatioLimit 0.001;
|
||||
}
|
||||
|
||||
additionalFeatures
|
||||
{}
|
||||
}
|
||||
|
||||
|
||||
initialPoints
|
||||
{
|
||||
minimumSurfaceDistanceCoeff 0.55;
|
||||
fixInitialPoints false;
|
||||
|
||||
initialPointsMethod autoDensity;
|
||||
autoDensityCoeffs
|
||||
{
|
||||
minLevels 4;
|
||||
maxSizeRatio 5.0;
|
||||
sampleResolution 5;
|
||||
surfaceSampleResolution 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
motionControl
|
||||
{
|
||||
maxSmoothingIterations 100;
|
||||
|
||||
cellAspectRatioControl
|
||||
{
|
||||
aspectRatio 1.0;
|
||||
aspectRatioDirection (1 0 0);
|
||||
}
|
||||
|
||||
relaxationModel adaptiveLinear;
|
||||
adaptiveLinearCoeffs
|
||||
{
|
||||
relaxationStart 1.0;
|
||||
relaxationEnd 0.0;
|
||||
}
|
||||
|
||||
objOutput no;
|
||||
timeChecks no;
|
||||
printVertexInfo off;
|
||||
|
||||
maxLoadUnbalance 0.2;
|
||||
|
||||
alignmentAcceptanceAngle 48;
|
||||
|
||||
pointInsertionCriteria
|
||||
{
|
||||
cellCentreDistCoeff 1.75;
|
||||
faceAreaRatioCoeff 0.0025;
|
||||
acceptanceAngle 21.5;
|
||||
}
|
||||
|
||||
pointRemovalCriteria
|
||||
{
|
||||
cellCentreDistCoeff 0.65;
|
||||
}
|
||||
|
||||
faceAreaWeightModel piecewiseLinearRamp;
|
||||
piecewiseLinearRampCoeffs
|
||||
{
|
||||
lowerAreaFraction 0.5;
|
||||
upperAreaFraction 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
polyMeshFiltering
|
||||
{
|
||||
filterEdges on;
|
||||
filterFaces off;
|
||||
writeTetDualMesh true;
|
||||
writeCellShapeControlMesh true;
|
||||
writeBackgroundMeshDecomposition true;
|
||||
}
|
||||
|
||||
|
||||
backgroundMeshDecomposition
|
||||
{
|
||||
minLevels 1;
|
||||
sampleResolution 4;
|
||||
spanScale 20;
|
||||
maxCellWeightCoeff 20;
|
||||
}
|
||||
|
||||
|
||||
meshQualityControls
|
||||
{
|
||||
#include "meshQualityDict"
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
79
etc/caseDicts/meshQualityDict
Normal file
79
etc/caseDicts/meshQualityDict
Normal file
@ -0,0 +1,79 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object meshQualityDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Maximum non-orthogonality allowed. Set to 180 to disable.
|
||||
maxNonOrtho 65;
|
||||
|
||||
//- Max skewness allowed. Set to <0 to disable.
|
||||
maxBoundarySkewness 20;
|
||||
maxInternalSkewness 4;
|
||||
|
||||
//- Max concaveness allowed. Is angle (in degrees) below which concavity
|
||||
// is allowed. 0 is straight face, <0 would be convex face.
|
||||
// Set to 180 to disable.
|
||||
maxConcave 80;
|
||||
|
||||
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
|
||||
// Set to a sensible fraction of the smallest cell volume expected.
|
||||
// Set to very negative number (e.g. -1E30) to disable.
|
||||
minVol 1e-13;
|
||||
|
||||
//- Minimum quality of the tet formed by the face-centre
|
||||
// and variable base point minimum decomposition triangles and
|
||||
// the cell centre. This has to be a positive number for tracking
|
||||
// to work. Set to very negative number (e.g. -1E30) to
|
||||
// disable.
|
||||
// <0 = inside out tet,
|
||||
// 0 = flat tet
|
||||
// 1 = regular tet
|
||||
minTetQuality 1e-15;
|
||||
|
||||
//- Minimum face area. Set to <0 to disable.
|
||||
minArea -1;
|
||||
|
||||
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
|
||||
// and face centre triangles normal
|
||||
minTwist 0.02;
|
||||
|
||||
//- Minimum normalised cell determinant. This is the determinant of all
|
||||
// the areas of internal faces. It is a measure of how much of the
|
||||
// outside area of the cell is to other cells. The idea is that if all
|
||||
// outside faces of the cell are 'floating' (zeroGradient) the
|
||||
// 'fixedness' of the cell is determined by the area of the internal faces.
|
||||
// 1 = hex, <= 0 = folded or flattened illegal cell
|
||||
minDeterminant 0.001;
|
||||
|
||||
//- Relative position of face in relation to cell centres (0.5 for orthogonal
|
||||
// mesh) (0 -> 0.5)
|
||||
minFaceWeight 0.05;
|
||||
|
||||
//- Volume ratio of neighbouring cells (0 -> 1)
|
||||
minVolRatio 0.01;
|
||||
|
||||
//- Per triangle normal compared to average normal. Like face twist
|
||||
// but now per (face-centre decomposition) triangle. Must be >0 for Fluent
|
||||
// compatibility
|
||||
minTriangleTwist -1;
|
||||
|
||||
|
||||
//- if >0 : preserve cells with all points on the surface if the
|
||||
// resulting volume after snapping (by approximation) is larger than
|
||||
// minVolCollapseRatio times old volume (i.e. not collapsed to flat cell).
|
||||
// If <0 : delete always.
|
||||
//minVolCollapseRatio 0.1;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
65
etc/caseDicts/setConstraintTypes
Normal file
65
etc/caseDicts/setConstraintTypes
Normal file
@ -0,0 +1,65 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
cyclic
|
||||
{
|
||||
type cyclic;
|
||||
}
|
||||
|
||||
cyclicAMI
|
||||
{
|
||||
type cyclicAMI;
|
||||
}
|
||||
|
||||
cyclicACMI
|
||||
{
|
||||
type cyclicACMI;
|
||||
}
|
||||
|
||||
cyclicSlip
|
||||
{
|
||||
type cyclicSlip;
|
||||
}
|
||||
|
||||
empty
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
|
||||
nonuniformTransformCyclic
|
||||
{
|
||||
type nonuniformTransformCyclic;
|
||||
}
|
||||
|
||||
processor
|
||||
{
|
||||
type processor;
|
||||
}
|
||||
|
||||
processorCyclic
|
||||
{
|
||||
type processorCyclic;
|
||||
}
|
||||
|
||||
symmetryPlane
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
|
||||
symmetry
|
||||
{
|
||||
type symmetry;
|
||||
}
|
||||
|
||||
wedge
|
||||
{
|
||||
type wedge;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
498
etc/cellModels
Normal file
498
etc/cellModels
Normal file
@ -0,0 +1,498 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// Foam Dictionary.
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
14
|
||||
(
|
||||
|
||||
unknown
|
||||
{
|
||||
index 0;
|
||||
numberOfPoints 0;
|
||||
|
||||
faces 0();
|
||||
|
||||
edges 0();
|
||||
}
|
||||
|
||||
|
||||
hex
|
||||
{
|
||||
index 3;
|
||||
numberOfPoints 8;
|
||||
|
||||
faces
|
||||
6
|
||||
(
|
||||
4(0 4 7 3) // x-min
|
||||
4(1 2 6 5) // x-max
|
||||
4(0 1 5 4) // y-min
|
||||
4(3 7 6 2) // y-max
|
||||
4(0 3 2 1) // z-min
|
||||
4(4 5 6 7) // z-max
|
||||
);
|
||||
|
||||
edges
|
||||
12
|
||||
(
|
||||
(0 1) // x-direction
|
||||
(3 2)
|
||||
(7 6)
|
||||
(4 5)
|
||||
(0 3) // y-direction
|
||||
(1 2)
|
||||
(5 6)
|
||||
(4 7)
|
||||
(0 4) // z-direction
|
||||
(1 5)
|
||||
(2 6)
|
||||
(3 7)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
wedge
|
||||
{
|
||||
index 4;
|
||||
numberOfPoints 7;
|
||||
|
||||
faces
|
||||
6
|
||||
(
|
||||
3(0 2 1)
|
||||
4(3 4 5 6)
|
||||
3(0 3 6)
|
||||
4(1 2 5 4)
|
||||
4(0 1 4 3)
|
||||
4(0 6 5 2)
|
||||
);
|
||||
|
||||
edges
|
||||
11
|
||||
(
|
||||
(0 1)
|
||||
(1 2)
|
||||
(0 2)
|
||||
(0 3)
|
||||
(0 6)
|
||||
(2 5)
|
||||
(1 4)
|
||||
(3 4)
|
||||
(3 6)
|
||||
(4 5)
|
||||
(5 6)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
prism
|
||||
{
|
||||
index 5;
|
||||
numberOfPoints 6;
|
||||
|
||||
faces
|
||||
5
|
||||
(
|
||||
3(0 2 1) // Bottom triangle
|
||||
3(3 4 5) // Top triangle
|
||||
|
||||
4(0 3 5 2) // Three side quadrilaterals
|
||||
4(1 2 5 4)
|
||||
4(0 1 4 3)
|
||||
);
|
||||
|
||||
edges
|
||||
9
|
||||
(
|
||||
(0 2)
|
||||
(0 1)
|
||||
(1 2)
|
||||
(3 5)
|
||||
(4 5)
|
||||
(3 4)
|
||||
(0 3)
|
||||
(1 4)
|
||||
(2 5)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
pyr
|
||||
{
|
||||
index 6;
|
||||
numberOfPoints 5;
|
||||
|
||||
faces
|
||||
5
|
||||
(
|
||||
// Base
|
||||
4(0 3 2 1)
|
||||
|
||||
// Sides
|
||||
3(0 4 3)
|
||||
3(3 4 2)
|
||||
3(1 2 4)
|
||||
3(0 1 4)
|
||||
);
|
||||
|
||||
edges
|
||||
8
|
||||
(
|
||||
(0 1)
|
||||
(1 2)
|
||||
(2 3)
|
||||
(0 3)
|
||||
(0 4)
|
||||
(1 4)
|
||||
(2 4)
|
||||
(3 4)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
tet
|
||||
{
|
||||
index 7;
|
||||
numberOfPoints 4;
|
||||
|
||||
faces
|
||||
4
|
||||
(
|
||||
3(1 2 3)
|
||||
3(0 3 2)
|
||||
3(0 1 3)
|
||||
3(0 2 1)
|
||||
);
|
||||
|
||||
edges
|
||||
6
|
||||
(
|
||||
(0 1)
|
||||
(0 2)
|
||||
(0 3)
|
||||
(3 1)
|
||||
(1 2)
|
||||
(3 2)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
tetWedge
|
||||
{
|
||||
index 9;
|
||||
numberOfPoints 5;
|
||||
|
||||
faces
|
||||
4
|
||||
(
|
||||
3(0 2 1)
|
||||
3(0 1 3)
|
||||
4(0 3 4 2)
|
||||
4(1 2 4 3)
|
||||
);
|
||||
|
||||
edges
|
||||
7
|
||||
(
|
||||
(0 1)
|
||||
(1 2)
|
||||
(0 2)
|
||||
(3 4)
|
||||
(0 3)
|
||||
(1 3)
|
||||
(2 4)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// split-hex. Used for embedded refinement
|
||||
splitHex
|
||||
{
|
||||
index 8;
|
||||
numberOfPoints 10;
|
||||
|
||||
faces
|
||||
7
|
||||
(
|
||||
4(9 3 0 8) // x-min1
|
||||
4(7 9 8 4) // x-min2
|
||||
4(5 1 2 6) // x-max
|
||||
4(4 0 1 5) // y-min
|
||||
4(2 3 7 6) // y-max
|
||||
4(3 2 1 0) // z-min
|
||||
4(7 4 5 6) // z-max
|
||||
);
|
||||
|
||||
edges
|
||||
17
|
||||
(
|
||||
(0 1) // x-direction
|
||||
(3 2)
|
||||
(7 6)
|
||||
(4 5)
|
||||
(0 3) // y-direction
|
||||
(8 9)
|
||||
(4 7)
|
||||
(5 6)
|
||||
(1 2)
|
||||
(0 4) // z-direction
|
||||
(0 8)
|
||||
(4 8)
|
||||
(1 5)
|
||||
(2 6)
|
||||
(3 7)
|
||||
(3 9)
|
||||
(7 9)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// SAMM cell types
|
||||
sammTrim1
|
||||
{
|
||||
index 11;
|
||||
numberOfPoints 10;
|
||||
|
||||
faces
|
||||
7
|
||||
(
|
||||
4(2 3 8 7) // x-min
|
||||
5(0 1 6 5 4) // x-max
|
||||
4(2 1 0 3) // y-min
|
||||
5(7 8 9 5 6) // y-max
|
||||
4(2 7 6 1) // z-min
|
||||
5(3 0 4 9 8) // z-max
|
||||
3(4 5 9) // cut
|
||||
);
|
||||
|
||||
edges
|
||||
15
|
||||
(
|
||||
(2 1) // x-direction
|
||||
(3 0)
|
||||
(8 9)
|
||||
(7 6)
|
||||
(2 7) // y-direction
|
||||
(3 8)
|
||||
(0 4)
|
||||
(1 6)
|
||||
(2 3) // z-direction
|
||||
(7 8)
|
||||
(6 5)
|
||||
(1 0)
|
||||
(4 5) // other
|
||||
(5 9)
|
||||
(10 5)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sammTrim2
|
||||
{
|
||||
index 12;
|
||||
numberOfPoints 10;
|
||||
|
||||
faces
|
||||
7
|
||||
(
|
||||
4(2 3 8 7) // x-min
|
||||
4(1 6 5 0) // x-max
|
||||
5(2 1 0 4 3) // y-min
|
||||
5(7 8 9 5 6) // y-max
|
||||
4(2 7 6 1) // z-min
|
||||
4(3 4 9 8) // z-max
|
||||
4(0 5 9 4) // other
|
||||
);
|
||||
|
||||
edges
|
||||
15
|
||||
(
|
||||
(2 1) // x-direction
|
||||
(3 4)
|
||||
(8 9)
|
||||
(7 6)
|
||||
(2 7) // y-direction
|
||||
(3 8)
|
||||
(4 9)
|
||||
(0 5)
|
||||
(1 6)
|
||||
(2 3) // z-direction
|
||||
(7 8)
|
||||
(6 5)
|
||||
(1 0)
|
||||
(9 5) // other
|
||||
(4 0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sammTrim3
|
||||
{
|
||||
index 13;
|
||||
numberOfPoints 10;
|
||||
|
||||
faces
|
||||
7
|
||||
(
|
||||
5(2 3 9 8 7) // x-min
|
||||
4(1 5 4 0) // x-max
|
||||
4(2 1 0 3) // y-min
|
||||
3(7 8 6) // y-max
|
||||
5(2 7 6 5 1) // z-min
|
||||
4(3 0 4 9) // z-max
|
||||
5(4 5 6 8 9) // other
|
||||
);
|
||||
|
||||
edges
|
||||
15
|
||||
(
|
||||
(2 1) // x-direction
|
||||
(3 0)
|
||||
(7 6)
|
||||
(2 7) // y-direction
|
||||
(3 9)
|
||||
(0 4)
|
||||
(1 5)
|
||||
(2 3) // z-direction
|
||||
(1 0)
|
||||
(8 7)
|
||||
(8 9) // other
|
||||
(9 4)
|
||||
(4 5)
|
||||
(5 6)
|
||||
(6 8)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sammTrim4
|
||||
{
|
||||
index 14;
|
||||
numberOfPoints 10;
|
||||
|
||||
faces
|
||||
7
|
||||
(
|
||||
5(0 2 6 5 1) // x-min
|
||||
3(3 9 8) // x-max
|
||||
5(0 3 8 7 2) // y-min
|
||||
3(1 5 4) // y-max
|
||||
5(0 1 4 9 3) // z-min
|
||||
3(2 7 6) // z-max
|
||||
6(4 5 6 7 8 9) // other
|
||||
);
|
||||
|
||||
edges
|
||||
15
|
||||
(
|
||||
(0 3) // x-direction
|
||||
(1 4)
|
||||
(2 7)
|
||||
(0 1) // y-direction
|
||||
(2 6)
|
||||
(3 9)
|
||||
(0 2) // z-direction
|
||||
(3 8)
|
||||
(1 5)
|
||||
(4 5) // other
|
||||
(5 6)
|
||||
(6 7)
|
||||
(7 8)
|
||||
(8 9)
|
||||
(9 4)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
sammTrim5
|
||||
{
|
||||
index 15;
|
||||
numberOfPoints 8;
|
||||
|
||||
faces
|
||||
6
|
||||
(
|
||||
4(2 3 7 6) // x-min
|
||||
3(1 5 0) // x-max
|
||||
5(2 1 0 4 3) // y-min
|
||||
4(2 6 5 1) // z-min
|
||||
3(3 4 7) // z-max
|
||||
5(0 5 6 7 4) // other
|
||||
);
|
||||
|
||||
edges
|
||||
12
|
||||
(
|
||||
(2 1) // x-direction
|
||||
(3 4)
|
||||
(2 6) // y-direction
|
||||
(3 7)
|
||||
(1 5)
|
||||
(2 3) // z-direction
|
||||
(1 0)
|
||||
(0 5) // other
|
||||
(5 6)
|
||||
(6 7)
|
||||
(7 4)
|
||||
(4 0)
|
||||
);
|
||||
}
|
||||
|
||||
// Equal to sammTrim8
|
||||
hexagonalPrism
|
||||
{
|
||||
index 18;
|
||||
numberOfPoints 12;
|
||||
|
||||
faces
|
||||
8
|
||||
(
|
||||
6(0 5 4 3 2 1) // bottom
|
||||
6(6 7 8 9 10 11) // top
|
||||
4(0 1 7 6) // sides
|
||||
4(1 2 8 7)
|
||||
4(2 3 9 8)
|
||||
4(3 4 10 9)
|
||||
4(4 5 11 10)
|
||||
4(5 0 6 11)
|
||||
);
|
||||
|
||||
edges
|
||||
18
|
||||
(
|
||||
(0 1) // bottom
|
||||
(1 2)
|
||||
(2 3)
|
||||
(3 4)
|
||||
(4 5)
|
||||
(5 0)
|
||||
(6 7) // top
|
||||
(7 8)
|
||||
(8 9)
|
||||
(9 10)
|
||||
(10 11)
|
||||
(11 6)
|
||||
(0 6) // sides
|
||||
(1 7)
|
||||
(2 8)
|
||||
(3 9)
|
||||
(4 10)
|
||||
(5 11)
|
||||
);
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
65
etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.C
Normal file
65
etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.C
Normal file
@ -0,0 +1,65 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "FilterFunctionObjectTemplate.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// dynamicCode:
|
||||
// SHA1 = ${SHA1sum}
|
||||
//
|
||||
// unique function name that can be checked if the correct library version
|
||||
// has been loaded
|
||||
void ${typeName}_${SHA1sum}(bool load)
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
// code that can be explicitly executed after loading
|
||||
}
|
||||
else
|
||||
{
|
||||
// code that can be explicitly executed before unloading
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineNamedTemplateTypeNameAndDebug(${typeName}FilterFunctionObject, 0);
|
||||
|
||||
//addToRunTimeSelectionTable
|
||||
addRemovableToRunTimeSelectionTable
|
||||
(
|
||||
functionObject,
|
||||
${typeName}FilterFunctionObject,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
51
etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.H
Normal file
51
etc/codeTemplates/dynamicCode/FilterFunctionObjectTemplate.H
Normal file
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
FunctionObject wrapper around functionObjectTemplate to allow them
|
||||
to be created via the functions entry within controlDict.
|
||||
|
||||
SourceFiles
|
||||
FilterFunctionObject.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef FilterFunctionObject_H
|
||||
#define FilterFunctionObject_H
|
||||
|
||||
#include "functionObjectTemplate.H"
|
||||
#include "OutputFilterFunctionObject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef OutputFilterFunctionObject<${typeName}FunctionObject>
|
||||
${typeName}FilterFunctionObject;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
50
etc/codeTemplates/dynamicCode/IOfunctionObjectTemplate.H
Normal file
50
etc/codeTemplates/dynamicCode/IOfunctionObjectTemplate.H
Normal file
@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::IOfunctionObjectTemplate
|
||||
|
||||
Description
|
||||
Instance of the generic IOOutputFilter for ${typeName}FunctionObject.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef IOfunctionObjectTemplate_H
|
||||
#define IOfunctionObjectTemplate_H
|
||||
|
||||
#include "functionObjectTemplate.H"
|
||||
#include "IOOutputFilter.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef IOOutputFilter<${typeName}FunctionObject>
|
||||
IO${typeName}FunctionObject;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
71
etc/codeTemplates/dynamicCode/codeStreamTemplate.C
Normal file
71
etc/codeTemplates/dynamicCode/codeStreamTemplate.C
Normal file
@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Template for use with codeStream.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "Ostream.H"
|
||||
#include "Pstream.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
//{{{ begin codeInclude
|
||||
${codeInclude}
|
||||
//}}} end codeInclude
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
//{{{ begin localCode
|
||||
${localCode}
|
||||
//}}} end localCode
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void ${typeName}
|
||||
(
|
||||
Ostream& os,
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
//{{{ begin code
|
||||
${code}
|
||||
//}}} end code
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
204
etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C
Normal file
204
etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C
Normal file
@ -0,0 +1,204 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "codedFvOptionTemplate.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "unitConversion.H"
|
||||
#include "fvMatrix.H"
|
||||
|
||||
//{{{ begin codeInclude
|
||||
${codeInclude}
|
||||
//}}} end codeInclude
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
//{{{ begin localCode
|
||||
${localCode}
|
||||
//}}} end localCode
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// dynamicCode:
|
||||
// SHA1 = ${SHA1sum}
|
||||
//
|
||||
// unique function name that can be checked if the correct library version
|
||||
// has been loaded
|
||||
void ${typeName}_${SHA1sum}(bool load)
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
// code that can be explicitly executed after loading
|
||||
}
|
||||
else
|
||||
{
|
||||
// code that can be explicitly executed before unloading
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
//makeRemovablePatchTypeField
|
||||
//(
|
||||
// fvPatch${FieldType},
|
||||
// ${typeName}FvOption${SourceType}
|
||||
//);
|
||||
defineTypeNameAndDebug(${typeName}FvOption${SourceType}, 0);
|
||||
addRemovableToRunTimeSelectionTable
|
||||
(
|
||||
option,
|
||||
${typeName}FvOption${SourceType},
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
const char* const ${typeName}FvOption${SourceType}::SHA1sum =
|
||||
"${SHA1sum}";
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FvOption${SourceType}::
|
||||
${typeName}FvOption${SourceType}
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
option(name, modelType, dict, mesh)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from components\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FvOption${SourceType}::
|
||||
~${typeName}FvOption${SourceType}()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void ${typeName}FvOption${SourceType}::correct
|
||||
(
|
||||
GeometricField<${TemplateType}, fvPatchField, volMesh>& fld
|
||||
)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"${typeName}FvOption${SourceType}::correct()\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeCorrect}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvOption${SourceType}::addSup
|
||||
(
|
||||
fvMatrix<${TemplateType}>& eqn,
|
||||
const label fieldI
|
||||
)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"${typeName}FvOption${SourceType}::addSup()\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeAddSup}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvOption${SourceType}::addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<${TemplateType}>& eqn,
|
||||
const label fieldI
|
||||
)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"${typeName}FvOption${SourceType}::addSup()\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeAddSup}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FvOption${SourceType}::setValue
|
||||
(
|
||||
fvMatrix<${TemplateType}>& eqn,
|
||||
const label fieldI
|
||||
)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"${typeName}FvOption${SourceType}::setValue()\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeSetValue}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
} // End namespace fv
|
||||
// ************************************************************************* //
|
||||
193
etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H
Normal file
193
etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H
Normal file
@ -0,0 +1,193 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Template for use with dynamic code generation of a source.
|
||||
The hook functions take the following arguments:
|
||||
|
||||
codeCorrect
|
||||
(
|
||||
GeometricField<Type, fvPatchField, volMesh>& fld
|
||||
)
|
||||
|
||||
codeAddSup
|
||||
(
|
||||
fvMatrix<Type}>& eqn,
|
||||
const label fieldI
|
||||
)
|
||||
|
||||
setValue
|
||||
(
|
||||
fvMatrix<Type}>& eqn,
|
||||
const label fieldI
|
||||
)
|
||||
|
||||
where :
|
||||
fld is the field in fieldNames
|
||||
eqn is the fvMatrix
|
||||
|
||||
energySource
|
||||
{
|
||||
type scalarCodedSource;
|
||||
|
||||
active true;
|
||||
selectionMode all;
|
||||
|
||||
scalarCodedSourceCoeffs
|
||||
{
|
||||
fieldNames (h);
|
||||
redirectType sourceTime;
|
||||
|
||||
codeInclude
|
||||
#{
|
||||
|
||||
#};
|
||||
|
||||
codeCorrect
|
||||
#{
|
||||
Pout<< "**codeCorrect**" << endl;
|
||||
#};
|
||||
|
||||
codeAddSup
|
||||
#{
|
||||
const Time& time = mesh().time();
|
||||
const scalarField& V = mesh_.V();
|
||||
scalarField& heSource = eqn.source();
|
||||
heSource -= 0.1*sqr(time.value())*V;
|
||||
#};
|
||||
|
||||
codeSetValue
|
||||
#{
|
||||
Pout<< "**codeSetValue**" << endl;
|
||||
#};
|
||||
|
||||
// Dummy entry. Make dependent on above to trigger recompilation
|
||||
code
|
||||
#{
|
||||
$codeInclude
|
||||
$codeCorrect
|
||||
$codeAddSup
|
||||
$codeSetValue
|
||||
#};
|
||||
}
|
||||
|
||||
sourceTimeCoeffs
|
||||
{
|
||||
// Dummy entry
|
||||
}
|
||||
}
|
||||
|
||||
SourceFiles
|
||||
codedFvOptionTemplate.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef codedFvOptionTemplate_H
|
||||
#define codedFvOptionTemplate_H
|
||||
|
||||
#include "fvOption.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
A templated CodedFvOption
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ${typeName}FvOption${SourceType}
|
||||
:
|
||||
public option
|
||||
{
|
||||
public:
|
||||
|
||||
//- Information about the SHA1 of the code itself
|
||||
static const char* const SHA1sum;
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("${typeName}");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
${typeName}FvOption${SourceType}
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
);
|
||||
|
||||
//- Destructor
|
||||
virtual ~${typeName}FvOption${SourceType}();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Correct field
|
||||
virtual void correct
|
||||
(
|
||||
GeometricField<${TemplateType}, fvPatchField, volMesh>&
|
||||
);
|
||||
|
||||
//- Explicit and implicit matrix contributions
|
||||
virtual void addSup
|
||||
(
|
||||
fvMatrix<${TemplateType}>& eqn,
|
||||
const label fieldI
|
||||
);
|
||||
|
||||
//- Explicit and implicit matrix contributions for compressible
|
||||
// equations
|
||||
virtual void addSup
|
||||
(
|
||||
const volScalarField& rho,
|
||||
fvMatrix<${TemplateType}>& eqn,
|
||||
const label fieldI
|
||||
);
|
||||
|
||||
//- Set value
|
||||
virtual void setValue
|
||||
(
|
||||
fvMatrix<${TemplateType}>& eqn,
|
||||
const label fieldI
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
} // End namespace fv
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
211
etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C
Normal file
211
etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C
Normal file
@ -0,0 +1,211 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixedValueFvPatchFieldTemplate.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "unitConversion.H"
|
||||
//{{{ begin codeInclude
|
||||
${codeInclude}
|
||||
//}}} end codeInclude
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
//{{{ begin localCode
|
||||
${localCode}
|
||||
//}}} end localCode
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// dynamicCode:
|
||||
// SHA1 = ${SHA1sum}
|
||||
//
|
||||
// unique function name that can be checked if the correct library version
|
||||
// has been loaded
|
||||
void ${typeName}_${SHA1sum}(bool load)
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
// code that can be explicitly executed after loading
|
||||
}
|
||||
else
|
||||
{
|
||||
// code that can be explicitly executed before unloading
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makeRemovablePatchTypeField
|
||||
(
|
||||
fvPatch${FieldType},
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
);
|
||||
|
||||
|
||||
const char* const ${typeName}FixedValueFvPatch${FieldType}::SHA1sum =
|
||||
"${SHA1sum}";
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FixedValueFvPatch${FieldType}::
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<${TemplateType}>(p, iF)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/DimensionedField\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValueFvPatch${FieldType}::
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValueFvPatch${FieldType}& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/DimensionedField/mapper\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValueFvPatch${FieldType}::
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<${TemplateType}>(p, iF, dict)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/dictionary\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValueFvPatch${FieldType}::
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValueFvPatch${FieldType}& ptf
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<${TemplateType}>(ptf)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" as copy\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValueFvPatch${FieldType}::
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValueFvPatch${FieldType}& ptf,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<${TemplateType}>(ptf, iF)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum} "
|
||||
"as copy/DimensionedField\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FixedValueFvPatch${FieldType}::
|
||||
~${typeName}FixedValueFvPatch${FieldType}()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void ${typeName}FixedValueFvPatch${FieldType}::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${code}
|
||||
//}}} end code
|
||||
|
||||
this->fixedValueFvPatchField<${TemplateType}>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
142
etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H
Normal file
142
etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H
Normal file
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Template for use with dynamic code generation of a
|
||||
fixedValue fvPatchField.
|
||||
|
||||
- without state
|
||||
|
||||
SourceFiles
|
||||
fixedValueFvPatchFieldTemplate.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fixedValueFvPatchTemplate${FieldType}_H
|
||||
#define fixedValueFvPatchTemplate${FieldType}_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
A templated FixedValueFvPatch
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ${typeName}FixedValueFvPatch${FieldType}
|
||||
:
|
||||
public fixedValueFvPatchField<${TemplateType}>
|
||||
{
|
||||
public:
|
||||
|
||||
//- Information about the SHA1 of the code itself
|
||||
static const char* const SHA1sum;
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("${typeName}");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping a copy onto a new patch
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValueFvPatch${FieldType}&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValueFvPatch${FieldType}&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp< fvPatch${FieldType} > clone() const
|
||||
{
|
||||
return tmp< fvPatch${FieldType} >
|
||||
(
|
||||
new ${typeName}FixedValueFvPatch${FieldType}(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
${typeName}FixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValueFvPatch${FieldType}&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp< fvPatch${FieldType} > clone
|
||||
(
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp< fvPatch${FieldType} >
|
||||
(
|
||||
new ${typeName}FixedValueFvPatch${FieldType}(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~${typeName}FixedValueFvPatch${FieldType}();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,211 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fixedValuePointPatchFieldTemplate.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "pointPatchFieldMapper.H"
|
||||
#include "pointFields.H"
|
||||
#include "unitConversion.H"
|
||||
//{{{ begin codeInclude
|
||||
${codeInclude}
|
||||
//}}} end codeInclude
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
//{{{ begin localCode
|
||||
${localCode}
|
||||
//}}} end localCode
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// dynamicCode:
|
||||
// SHA1 = ${SHA1sum}
|
||||
//
|
||||
// unique function name that can be checked if the correct library version
|
||||
// has been loaded
|
||||
void ${typeName}_${SHA1sum}(bool load)
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
// code that can be explicitly executed after loading
|
||||
}
|
||||
else
|
||||
{
|
||||
// code that can be explicitly executed before unloading
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchTypeField
|
||||
(
|
||||
pointPatch${FieldType},
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
);
|
||||
|
||||
|
||||
const char* const ${typeName}FixedValuePointPatch${FieldType}::SHA1sum =
|
||||
"${SHA1sum}";
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FixedValuePointPatch${FieldType}::
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<${TemplateType}, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<${TemplateType}>(p, iF)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/DimensionedField\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValuePointPatch${FieldType}::
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValuePointPatch${FieldType}& ptf,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<${TemplateType}, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<${TemplateType}>(ptf, p, iF, mapper)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/DimensionedField/mapper\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValuePointPatch${FieldType}::
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<${TemplateType}, pointMesh>& iF,
|
||||
const dictionary& dict,
|
||||
const bool valueRequired
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<${TemplateType}>(p, iF, dict, valueRequired)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/dictionary\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValuePointPatch${FieldType}::
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValuePointPatch${FieldType}& ptf
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<${TemplateType}>(ptf)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" as copy\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}FixedValuePointPatch${FieldType}::
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValuePointPatch${FieldType}& ptf,
|
||||
const DimensionedField<${TemplateType}, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<${TemplateType}>(ptf, iF)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum} "
|
||||
"as copy/DimensionedField\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FixedValuePointPatch${FieldType}::
|
||||
~${typeName}FixedValuePointPatch${FieldType}()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void ${typeName}FixedValuePointPatch${FieldType}::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${code}
|
||||
//}}} end code
|
||||
|
||||
this->fixedValuePointPatchField<${TemplateType}>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,143 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Template for use with dynamic code generation of a
|
||||
fixedValue pointPatchField.
|
||||
|
||||
- without state
|
||||
|
||||
SourceFiles
|
||||
fixedValuePointPatchFieldTemplate.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fixedValuePointPatchTemplate${FieldType}_H
|
||||
#define fixedValuePointPatchTemplate${FieldType}_H
|
||||
|
||||
#include "fixedValuePointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
A templated FixedValuePointPatchField
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ${typeName}FixedValuePointPatch${FieldType}
|
||||
:
|
||||
public fixedValuePointPatchField<${TemplateType}>
|
||||
{
|
||||
public:
|
||||
|
||||
//- Information about the SHA1 of the code itself
|
||||
static const char* const SHA1sum;
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("${typeName}");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<${TemplateType}, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<${TemplateType}, pointMesh>&,
|
||||
const dictionary&,
|
||||
const bool valueRequired=true
|
||||
);
|
||||
|
||||
//- Construct by mapping a copy onto a new patch
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValuePointPatch${FieldType}&,
|
||||
const pointPatch&,
|
||||
const DimensionedField<${TemplateType}, pointMesh>&,
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValuePointPatch${FieldType}&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr< pointPatchField<${TemplateType}> > clone() const
|
||||
{
|
||||
return autoPtr< pointPatchField<${TemplateType}> >
|
||||
(
|
||||
new ${typeName}FixedValuePointPatch${FieldType}(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
${typeName}FixedValuePointPatch${FieldType}
|
||||
(
|
||||
const ${typeName}FixedValuePointPatch${FieldType}&,
|
||||
const DimensionedField<${TemplateType}, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual autoPtr< pointPatchField<${TemplateType}> > clone
|
||||
(
|
||||
const DimensionedField<${TemplateType}, pointMesh>& iF
|
||||
) const
|
||||
{
|
||||
return autoPtr< pointPatchField<${TemplateType}> >
|
||||
(
|
||||
new ${typeName}FixedValuePointPatch${FieldType}(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~${typeName}FixedValuePointPatch${FieldType}();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
156
etc/codeTemplates/dynamicCode/functionObjectTemplate.C
Normal file
156
etc/codeTemplates/dynamicCode/functionObjectTemplate.C
Normal file
@ -0,0 +1,156 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "functionObjectTemplate.H"
|
||||
#include "Time.H"
|
||||
#include "fvCFD.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(${typeName}FunctionObject, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
//{{{ begin localCode
|
||||
${localCode}
|
||||
//}}} end localCode
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
const objectRegistry& ${typeName}FunctionObject::obr() const
|
||||
{
|
||||
return obr_;
|
||||
}
|
||||
|
||||
|
||||
const fvMesh& ${typeName}FunctionObject::mesh() const
|
||||
{
|
||||
return refCast<const fvMesh>(obr_);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FunctionObject::${typeName}FunctionObject
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const bool
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
obr_(obr)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}FunctionObject::~${typeName}FunctionObject()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void ${typeName}FunctionObject::read(const dictionary& dict)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"read ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeRead}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FunctionObject::execute()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"execute ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeExecute}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FunctionObject::end()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"end ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${codeEnd}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FunctionObject::timeSet()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"timeSet ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin codeTime
|
||||
${codeTimeSet}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
|
||||
void ${typeName}FunctionObject::write()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"write ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${code}
|
||||
//}}} end code
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
151
etc/codeTemplates/dynamicCode/functionObjectTemplate.H
Normal file
151
etc/codeTemplates/dynamicCode/functionObjectTemplate.H
Normal file
@ -0,0 +1,151 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Template for use with dynamic code generation of a
|
||||
OutputFilter functionObject.
|
||||
|
||||
SourceFiles
|
||||
functionObjectTemplate.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjectTemplate_H
|
||||
#define functionObjectTemplate_H
|
||||
|
||||
#include "stringList.H"
|
||||
#include "pointField.H"
|
||||
|
||||
//{{{ begin codeInclude
|
||||
${codeInclude}
|
||||
//}}} end codeInclude
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class objectRegistry;
|
||||
class dictionary;
|
||||
class polyMesh;
|
||||
class mapPolyMesh;
|
||||
class fvMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
A templated functionObject
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ${typeName}FunctionObject
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of this set of system calls
|
||||
word name_;
|
||||
|
||||
//- Registry
|
||||
const objectRegistry& obr_;
|
||||
|
||||
//{{{ begin codeData
|
||||
${codeData}
|
||||
//}}} end codeData
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
const objectRegistry& obr() const;
|
||||
|
||||
const fvMesh& mesh() const;
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
${typeName}FunctionObject(const ${typeName}FunctionObject&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const ${typeName}FunctionObject&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("${typeName}");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for given objectRegistry and dictionary.
|
||||
// Allow the possibility to load fields from files
|
||||
${typeName}FunctionObject
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& unused,
|
||||
const dictionary&,
|
||||
const bool loadFromFilesUnused = false
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~${typeName}FunctionObject();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return name of the system call set
|
||||
virtual const word& name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
//- Read the system calls
|
||||
virtual void read(const dictionary&);
|
||||
|
||||
//- Execute the "executeCalls" at each time-step
|
||||
virtual void execute();
|
||||
|
||||
//- Execute the "endCalls" at the final time-loop
|
||||
virtual void end();
|
||||
|
||||
//- Write, execute the "writeCalls"
|
||||
virtual void write();
|
||||
|
||||
//- Called when time was set at the end of the Time::operator++
|
||||
virtual void timeSet();
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const mapPolyMesh&)
|
||||
{}
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void movePoints(const polyMesh&)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
211
etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C
Normal file
211
etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C
Normal file
@ -0,0 +1,211 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "mixedFvPatchFieldTemplate.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "unitConversion.H"
|
||||
//{{{ begin codeInclude
|
||||
${codeInclude}
|
||||
//}}} end codeInclude
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
//{{{ begin localCode
|
||||
${localCode}
|
||||
//}}} end localCode
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// dynamicCode:
|
||||
// SHA1 = ${SHA1sum}
|
||||
//
|
||||
// unique function name that can be checked if the correct library version
|
||||
// has been loaded
|
||||
void ${typeName}_${SHA1sum}(bool load)
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
// code that can be explicitly executed after loading
|
||||
}
|
||||
else
|
||||
{
|
||||
// code that can be explicitly executed before unloading
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makeRemovablePatchTypeField
|
||||
(
|
||||
fvPatch${FieldType},
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
);
|
||||
|
||||
|
||||
const char* const ${typeName}MixedValueFvPatch${FieldType}::SHA1sum =
|
||||
"${SHA1sum}";
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}MixedValueFvPatch${FieldType}::
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<${TemplateType}>(p, iF)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/DimensionedField\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}MixedValueFvPatch${FieldType}::
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}MixedValueFvPatch${FieldType}& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/DimensionedField/mapper\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}MixedValueFvPatch${FieldType}::
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<${TemplateType}>(p, iF, dict)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" from patch/dictionary\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}MixedValueFvPatch${FieldType}::
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}MixedValueFvPatch${FieldType}& ptf
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<${TemplateType}>(ptf)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum}"
|
||||
" as copy\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
${typeName}MixedValueFvPatch${FieldType}::
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}MixedValueFvPatch${FieldType}& ptf,
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<${TemplateType}>(ptf, iF)
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"construct ${typeName} sha1: ${SHA1sum} "
|
||||
"as copy/DimensionedField\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
${typeName}MixedValueFvPatch${FieldType}::
|
||||
~${typeName}MixedValueFvPatch${FieldType}()
|
||||
{
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void ${typeName}MixedValueFvPatch${FieldType}::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (${verbose:-false})
|
||||
{
|
||||
Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
|
||||
}
|
||||
|
||||
//{{{ begin code
|
||||
${code}
|
||||
//}}} end code
|
||||
|
||||
this->mixedFvPatchField<${TemplateType}>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
142
etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H
Normal file
142
etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H
Normal file
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Template for use with dynamic code generation of a
|
||||
mixed fvPatchField.
|
||||
|
||||
- without state
|
||||
|
||||
SourceFiles
|
||||
mixedFvPatchFieldTemplate.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef mixedFvPatchTemplate${FieldType}_H
|
||||
#define mixedFvPatchTemplate${FieldType}_H
|
||||
|
||||
#include "mixedFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
A templated MixedValueFvPatchField
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ${typeName}MixedValueFvPatch${FieldType}
|
||||
:
|
||||
public mixedFvPatchField<${TemplateType}>
|
||||
{
|
||||
public:
|
||||
|
||||
//- Information about the SHA1 of the code itself
|
||||
static const char* const SHA1sum;
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("${typeName}");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping a copy onto a new patch
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}MixedValueFvPatch${FieldType}&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}MixedValueFvPatch${FieldType}&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp< fvPatch${FieldType} > clone() const
|
||||
{
|
||||
return tmp< fvPatch${FieldType} >
|
||||
(
|
||||
new ${typeName}MixedValueFvPatch${FieldType}(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
${typeName}MixedValueFvPatch${FieldType}
|
||||
(
|
||||
const ${typeName}MixedValueFvPatch${FieldType}&,
|
||||
const DimensionedField<${TemplateType}, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp< fvPatch${FieldType} > clone
|
||||
(
|
||||
const DimensionedField<${TemplateType}, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp< fvPatch${FieldType} >
|
||||
(
|
||||
new ${typeName}MixedValueFvPatch${FieldType}(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~${typeName}MixedValueFvPatch${FieldType}();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
31
etc/codeTemplates/foamCommentStyles
Normal file
31
etc/codeTemplates/foamCommentStyles
Normal file
@ -0,0 +1,31 @@
|
||||
1234567890123456789012345678901234567890123456789012345678901234567890123456789
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
32
etc/codeTemplates/foamScript
Normal file
32
etc/codeTemplates/foamScript
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
#
|
||||
#
|
||||
# Description
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
102
etc/codeTemplates/source/_Template.C
Normal file
102
etc/codeTemplates/source/_Template.C
Normal file
@ -0,0 +1,102 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CLASSNAME.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const dataType Foam::CLASSNAME::staticData();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CLASSNAME::CLASSNAME()
|
||||
:
|
||||
baseClassName(),
|
||||
data_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::CLASSNAME::CLASSNAME(const dataType& data)
|
||||
:
|
||||
baseClassName(),
|
||||
data_(data)
|
||||
{}
|
||||
|
||||
|
||||
Foam::CLASSNAME::CLASSNAME(const CLASSNAME&)
|
||||
:
|
||||
baseClassName(),
|
||||
data_()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::CLASSNAME>
|
||||
Foam::CLASSNAME::New()
|
||||
{
|
||||
return autoPtr<CLASSNAME>(new CLASSNAME);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CLASSNAME::~CLASSNAME()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::CLASSNAME::operator=(const CLASSNAME& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn("Foam::CLASSNAME::operator=(const Foam::CLASSNAME&)")
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
151
etc/codeTemplates/source/_Template.H
Normal file
151
etc/codeTemplates/source/_Template.H
Normal file
@ -0,0 +1,151 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::CLASSNAME
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
CLASSNAMEI.H
|
||||
CLASSNAME.C
|
||||
CLASSNAMEIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CLASSNAME_H
|
||||
#define CLASSNAME_H
|
||||
|
||||
#include ".H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Istream;
|
||||
class Ostream;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class CLASSNAME;
|
||||
Istream& operator>>(Istream&, CLASSNAME&);
|
||||
Ostream& operator<<(Ostream&, const CLASSNAME&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CLASSNAME Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class CLASSNAME
|
||||
:
|
||||
public baseClassName
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Description of data_
|
||||
dataType data_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
CLASSNAME(const CLASSNAME&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const CLASSNAME&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
//- Static data staticData
|
||||
static const dataType staticData;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
CLASSNAME();
|
||||
|
||||
//- Construct from components
|
||||
CLASSNAME(const dataType& data);
|
||||
|
||||
//- Construct from Istream
|
||||
CLASSNAME(Istream&);
|
||||
|
||||
//- Construct as copy
|
||||
CLASSNAME(const CLASSNAME&);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<CLASSNAME> New();
|
||||
|
||||
|
||||
//- Destructor
|
||||
~CLASSNAME();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// Check
|
||||
|
||||
// Edit
|
||||
|
||||
// Write
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const CLASSNAME&);
|
||||
|
||||
|
||||
// Friend Functions
|
||||
|
||||
// Friend Operators
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>(Istream&, CLASSNAME&);
|
||||
friend Ostream& operator<<(Ostream&, const CLASSNAME&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CLASSNAMEI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
48
etc/codeTemplates/source/_TemplateApp.C
Normal file
48
etc/codeTemplates/source/_TemplateApp.C
Normal file
@ -0,0 +1,48 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
CLASSNAME
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
58
etc/codeTemplates/source/_TemplateI.H
Normal file
58
etc/codeTemplates/source/_TemplateI.H
Normal file
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
70
etc/codeTemplates/source/_TemplateIO.C
Normal file
70
etc/codeTemplates/source/_TemplateIO.C
Normal file
@ -0,0 +1,70 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CLASSNAME.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CLASSNAME::CLASSNAME(Istream& is)
|
||||
:
|
||||
base1(is),
|
||||
base2(is),
|
||||
member1(is),
|
||||
member2(is)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check("Foam::CLASSNAME::CLASSNAME(Foam::Istream&)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, CLASSNAME&)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check
|
||||
(
|
||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CLASSNAME&)"
|
||||
);
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const CLASSNAME&)
|
||||
{
|
||||
// Check state of Ostream
|
||||
os.check
|
||||
(
|
||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
||||
"const Foam::CLASSNAME&)"
|
||||
);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
115
etc/codeTemplates/source/foamNewSource
Executable file
115
etc/codeTemplates/source/foamNewSource
Executable file
@ -0,0 +1,115 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# foamNewSource
|
||||
#
|
||||
# Description
|
||||
# Create a new standard OpenFOAM source file
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
Template="$WM_PROJECT_DIR/etc/codeTemplates/source/_Template"
|
||||
|
||||
usage() {
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
Usage: $Script [OPTION] <type> <ClassName>
|
||||
options:
|
||||
-help print the usage
|
||||
|
||||
* create a new standard OpenFOAM source file
|
||||
|
||||
type: (C|H|I|IO|App)
|
||||
|
||||
A ClassName starting with '-' will simply display the template
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
className="$2"
|
||||
unset subType Type printOpt
|
||||
|
||||
# for a className starting with '-' simply display the code
|
||||
if [ "${2#-}" != "${2}" ]
|
||||
then
|
||||
printOpt=true
|
||||
fi
|
||||
|
||||
|
||||
# this implicitly covers a lone -help
|
||||
[ "$#" -gt 1 ] || usage
|
||||
|
||||
case "$1" in
|
||||
(-h | -help)
|
||||
usage
|
||||
;;
|
||||
(C|H)
|
||||
Type=".$1"
|
||||
;;
|
||||
(I)
|
||||
Type="$1.H"
|
||||
;;
|
||||
(IO)
|
||||
Type="$1.C"
|
||||
;;
|
||||
(app|App)
|
||||
subType=App
|
||||
Type=".C"
|
||||
;;
|
||||
(*)
|
||||
usage "unknown type '$1'"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ "$#" -eq 2 ] || usage "wrong number of arguments"
|
||||
shift 2
|
||||
|
||||
|
||||
if [ "${printOpt:-false}" = true ]
|
||||
then
|
||||
cat $Template$subType$Type
|
||||
else
|
||||
|
||||
fileName="$className$Type"
|
||||
|
||||
echo "$Script: Creating new interface file $fileName"
|
||||
if [ -e "$fileName" ]
|
||||
then
|
||||
echo " Error: file exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# process class name
|
||||
sed "s/CLASSNAME/$className/g" $Template$subType$Type > $fileName
|
||||
|
||||
if [ "$subType" = App -a ! -d Make ]
|
||||
then
|
||||
wmakeFilesAndOptions
|
||||
fi
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
122
etc/codeTemplates/template/_TemplateTemplate.C
Normal file
122
etc/codeTemplates/template/_TemplateTemplate.C
Normal file
@ -0,0 +1,122 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CLASSNAME.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
const dataType Foam::CLASSNAME<TemplateArgument>::staticData();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME()
|
||||
:
|
||||
baseClassName(),
|
||||
data_()
|
||||
{}
|
||||
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME(const dataType& data)
|
||||
:
|
||||
baseClassName(),
|
||||
data_(data)
|
||||
{}
|
||||
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME
|
||||
(
|
||||
const CLASSNAME<TemplateArgument>&
|
||||
)
|
||||
:
|
||||
baseCLASSNAME(),
|
||||
data_()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::autoPtr<Foam::CLASSNAME<TemplateArgument> >
|
||||
Foam::CLASSNAME<TemplateArgument>::New()
|
||||
{
|
||||
return autoPtr<CLASSNAME<TemplateArgument> >
|
||||
(
|
||||
new CLASSNAME<TemplateArgument>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::CLASSNAME<TemplateArgument>::~CLASSNAME()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
void Foam::CLASSNAME<TemplateArgument>::operator=
|
||||
(
|
||||
const CLASSNAME<TemplateArgument>& rhs
|
||||
)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::CLASSNAME<TemplateArgument>::operator="
|
||||
"(const Foam::CLASSNAME<TemplateArgument>&)"
|
||||
) << "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
157
etc/codeTemplates/template/_TemplateTemplate.H
Normal file
157
etc/codeTemplates/template/_TemplateTemplate.H
Normal file
@ -0,0 +1,157 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::CLASSNAME
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
CLASSNAMEI.H
|
||||
CLASSNAME.C
|
||||
CLASSNAMEIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CLASSNAME_H
|
||||
#define CLASSNAME_H
|
||||
|
||||
#include ".H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class someClass;
|
||||
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
template<TemplateClassArgument>
|
||||
class CLASSNAME;
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Istream& operator>>(Istream&, CLASSNAME<TemplateArgument>&);
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Ostream& operator<<(Ostream&, const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CLASSNAME Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<TemplateClassArgument>
|
||||
class CLASSNAME
|
||||
:
|
||||
public baseClassName
|
||||
{
|
||||
// Private data
|
||||
|
||||
dataType data_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
CLASSNAME(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
//- Static data someStaticData
|
||||
static const dataType staticData;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
CLASSNAME();
|
||||
|
||||
//- Construct from components
|
||||
CLASSNAME(const dataType& data);
|
||||
|
||||
//- Construct from Istream
|
||||
CLASSNAME(Istream&);
|
||||
|
||||
//- Construct as copy
|
||||
CLASSNAME(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<CLASSNAME<TemplateArgument> > New();
|
||||
|
||||
|
||||
//- Destructor
|
||||
~CLASSNAME();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const CLASSNAME<TemplateArgument>&);
|
||||
|
||||
|
||||
// Friend Functions
|
||||
|
||||
// Friend Operators
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>> <TemplateArgument>
|
||||
(Istream&, CLASSNAME<TemplateArgument>&);
|
||||
|
||||
friend Ostream& operator<< <TemplateArgument>
|
||||
(Ostream&, const CLASSNAME<TemplateArgument>&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CLASSNAMEI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "CLASSNAME.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
58
etc/codeTemplates/template/_TemplateTemplateI.H
Normal file
58
etc/codeTemplates/template/_TemplateTemplateI.H
Normal file
@ -0,0 +1,58 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
82
etc/codeTemplates/template/_TemplateTemplateIO.C
Normal file
82
etc/codeTemplates/template/_TemplateTemplateIO.C
Normal file
@ -0,0 +1,82 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CLASSNAME.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::CLASSNAME<TemplateArgument>::CLASSNAME(Istream& is)
|
||||
:
|
||||
base1(is),
|
||||
base2(is),
|
||||
member1(is),
|
||||
member2(is)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check("Foam::CLASSNAME<TemplateArgument>::CLASSNAME(Foam::Istream&)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
CLASSNAME<TemplateArgument>&
|
||||
)
|
||||
{
|
||||
// Check state of Istream
|
||||
is.check
|
||||
(
|
||||
"Foam::Istream& Foam::operator>>"
|
||||
"(Foam::Istream&, Foam::CLASSNAME<TemplateArgument>&)"
|
||||
);
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
template<TemplateClassArgument>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const CLASSNAME<TemplateArgument>&
|
||||
)
|
||||
{
|
||||
// Check state of Ostream
|
||||
os.check
|
||||
(
|
||||
"Foam::Ostream& Foam::operator<<"
|
||||
"(Ostream&, const CLASSNAME<TemplateArgument>&)"
|
||||
);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
130
etc/codeTemplates/template/foamNewTemplate
Executable file
130
etc/codeTemplates/template/foamNewTemplate
Executable file
@ -0,0 +1,130 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# foamNewTemplate
|
||||
#
|
||||
# Description
|
||||
# Create a new standard OpenFOAM templated source file
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
Template="$WM_PROJECT_DIR/etc/codeTemplates/template/_TemplateTemplate"
|
||||
|
||||
usage() {
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
Usage: $Script [OPTION] <type> <ClassName> <Template arguments...>
|
||||
options:
|
||||
-help print the usage
|
||||
|
||||
* create a new standard OpenFOAM source file for templated classes
|
||||
|
||||
type: (C|H|I|IO)
|
||||
|
||||
A ClassName starting with '-' will simply display the template
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
# this implicitly covers a lone -help
|
||||
[ "$#" -gt 1 ] || usage
|
||||
|
||||
|
||||
className="$2"
|
||||
unset Type printOpt
|
||||
|
||||
# for a className starting with '-' simply display the code
|
||||
if [ "${2#-}" != "${2}" ]
|
||||
then
|
||||
printOpt=true
|
||||
fi
|
||||
|
||||
|
||||
case "$1" in
|
||||
(-h | -help)
|
||||
usage
|
||||
;;
|
||||
(C|H)
|
||||
Type=".$1"
|
||||
;;
|
||||
(I)
|
||||
Type="$1.H"
|
||||
;;
|
||||
(IO)
|
||||
Type="$1.C"
|
||||
;;
|
||||
*)
|
||||
usage "unknown type '$1'"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ "${printOpt:-false}" = true ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || usage "wrong number of arguments"
|
||||
shift 2
|
||||
|
||||
cat $Template$Type
|
||||
|
||||
else
|
||||
|
||||
[ "$#" -ge 3 ] || usage "wrong number of arguments"
|
||||
shift 2
|
||||
|
||||
fileName="$className$Type"
|
||||
|
||||
echo "$Script: Creating new template interface file $fileName"
|
||||
if [ -e "$fileName" ]
|
||||
then
|
||||
echo " Error: file exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# process class name
|
||||
sed -e "s/CLASSNAME/$className/g" $Template$Type > $fileName.1
|
||||
|
||||
|
||||
# process remaining (template) arguments
|
||||
for tArg
|
||||
do
|
||||
sed -e "s/TemplateClassArgument/class $tArg, TemplateClassArgument/g" \
|
||||
-e "s/TemplateArgument/$tArg, TemplateArgument/g" \
|
||||
$fileName.1 > $fileName.2
|
||||
|
||||
mv $fileName.2 $fileName.1
|
||||
done
|
||||
|
||||
|
||||
# remove remaining ", Template .."
|
||||
sed -e "s/, TemplateClassArgument//g" \
|
||||
-e "s/, TemplateArgument//g" \
|
||||
$fileName.1 > $fileName
|
||||
|
||||
rm $fileName.1
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
54
etc/config/CGAL.csh
Normal file
54
etc/config/CGAL.csh
Normal file
@ -0,0 +1,54 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/CGAL.csh
|
||||
#
|
||||
# Description
|
||||
# Setup file for CGAL (& boost) include/libraries.
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
|
||||
##------------------------------------------------------------------------------
|
||||
|
||||
set boost_version=boost-system
|
||||
set cgal_version=CGAL-4.3
|
||||
|
||||
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
||||
setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using CGAL and boost"
|
||||
echo " $cgal_version at $CGAL_ARCH_PATH"
|
||||
echo " $boost_version at $BOOST_ARCH_PATH"
|
||||
endif
|
||||
|
||||
if ( -d "$CGAL_ARCH_PATH" ) then
|
||||
_foamAddLib $CGAL_ARCH_PATH/lib
|
||||
endif
|
||||
|
||||
if ( -d "$BOOST_ARCH_PATH" ) then
|
||||
_foamAddLib $BOOST_ARCH_PATH/lib
|
||||
endif
|
||||
|
||||
unset boost_version cgal_version
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
57
etc/config/CGAL.sh
Normal file
57
etc/config/CGAL.sh
Normal file
@ -0,0 +1,57 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/CGAL.sh
|
||||
#
|
||||
# Description
|
||||
# Setup file for CGAL (& boost) include/libraries.
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
boost_version=boost-system
|
||||
cgal_version=CGAL-4.3
|
||||
|
||||
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
||||
export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using CGAL and boost"
|
||||
echo " $cgal_version at $CGAL_ARCH_PATH"
|
||||
echo " $boost_version at $BOOST_ARCH_PATH"
|
||||
fi
|
||||
|
||||
if [ -d "$CGAL_ARCH_PATH" ]
|
||||
then
|
||||
_foamAddLib $CGAL_ARCH_PATH/lib
|
||||
fi
|
||||
|
||||
if [ -d "$BOOST_ARCH_PATH" ]
|
||||
then
|
||||
_foamAddLib $BOOST_ARCH_PATH/lib
|
||||
fi
|
||||
|
||||
unset boost_version cgal_version
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
54
etc/config/README
Normal file
54
etc/config/README
Normal file
@ -0,0 +1,54 @@
|
||||
The main OpenFOAM settings are located in the parent etc/ directory
|
||||
|
||||
* bashrc, cshrc
|
||||
entry point for sourcing
|
||||
|
||||
* prefs.csh, prefs.sh
|
||||
these files are untracked and can be used for some site-defined
|
||||
settings
|
||||
|
||||
|
||||
The etc/config/ directory contains various configuration files in
|
||||
sh/csh variants:
|
||||
|
||||
* settings.csh, settings.sh
|
||||
core settings
|
||||
|
||||
* aliases.csh, aliases.sh
|
||||
aliases for interactive shells
|
||||
|
||||
* unset.csh, unset.sh
|
||||
sourced to clear as many OpenFOAM environment settings as possible
|
||||
|
||||
|
||||
* ensight.csh, ensight.sh
|
||||
application settings for EnSight
|
||||
|
||||
* paraview.csh, paraview.sh
|
||||
application settings for ParaView
|
||||
|
||||
* scotch.sh
|
||||
application settings for compiling against scotch
|
||||
|
||||
* metis.sh
|
||||
application settings for compiling against metis 5
|
||||
|
||||
---
|
||||
|
||||
The config/example directory contains various example configuration files
|
||||
in sh/csh variants
|
||||
|
||||
* compiler.csh, compiler.sh
|
||||
an example of fine tuning ThirdParty compiler settings for OpenFOAM
|
||||
|
||||
* openmpi.csh, openmpi.sh
|
||||
an example of fine tuning openmpi settings for OpenFOAM
|
||||
|
||||
* paraview.csh, paraview.sh
|
||||
an example of chaining to the standard config/paraview.sh with a
|
||||
different ParaView_VERSION
|
||||
|
||||
* prefs.csh, prefs.sh
|
||||
an example of supplying alternative site-defined settings
|
||||
|
||||
---
|
||||
80
etc/config/aliases.csh
Normal file
80
etc/config/aliases.csh
Normal file
@ -0,0 +1,80 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config/aliases.csh
|
||||
#
|
||||
# Description
|
||||
# Aliases for working with OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/cshrc and/or ~/.cshrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Change compiled version aliases
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias wmSET 'source $WM_PROJECT_DIR/etc/cshrc'
|
||||
alias wm64 'wmSET WM_ARCH_OPTION=64'
|
||||
alias wm32 'wmSET WM_ARCH_OPTION=32'
|
||||
alias wmSP 'wmSET WM_PRECISION_OPTION=SP'
|
||||
alias wmDP 'wmSET WM_PRECISION_OPTION=DP'
|
||||
|
||||
# clear env
|
||||
alias wmUNSET='source $WM_PROJECT_DIR/etc/config/unset.csh'
|
||||
|
||||
# Toggle wmakeScheduler on/off
|
||||
# - also need to set WM_HOSTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler'
|
||||
alias wmSchedOFF 'unsetenv WM_SCHEDULER'
|
||||
|
||||
# Change ParaView version
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias foamPV 'source `$WM_PROJECT_DIR/etc/config/paraview.csh` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
|
||||
|
||||
|
||||
# Change directory aliases
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias src 'cd $FOAM_SRC'
|
||||
alias lib 'cd $FOAM_LIBBIN'
|
||||
alias run 'cd $FOAM_RUN'
|
||||
alias foam 'cd $WM_PROJECT_DIR'
|
||||
alias foamsrc 'cd $FOAM_SRC/$WM_PROJECT'
|
||||
alias foamfv 'cd $FOAM_SRC/finiteVolume'
|
||||
alias app 'cd $FOAM_APP'
|
||||
alias util 'cd $FOAM_UTILITIES'
|
||||
alias sol 'cd $FOAM_SOLVERS'
|
||||
alias tut 'cd $FOAM_TUTORIALS'
|
||||
|
||||
alias foamApps 'cd $FOAM_APP'
|
||||
alias foamSol 'cd $FOAM_SOLVERS'
|
||||
alias foamTuts 'cd $FOAM_TUTORIALS'
|
||||
alias foamUtils 'cd $FOAM_UTILITIES'
|
||||
alias foam3rdParty 'cd $WM_THIRD_PARTY_DIR'
|
||||
|
||||
if ( $?WM_PROJECT_SITE ) then
|
||||
alias foamSite 'cd $WM_PROJECT_SITE'
|
||||
else
|
||||
alias foamSite 'cd $WM_PROJECT_INST_DIR/site'
|
||||
endif
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
86
etc/config/aliases.sh
Normal file
86
etc/config/aliases.sh
Normal file
@ -0,0 +1,86 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config/aliases.sh
|
||||
#
|
||||
# Description
|
||||
# Aliases for working with OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc and/or ~/.bashrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Change compiled version aliases
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias wmSET='. $WM_PROJECT_DIR/etc/bashrc'
|
||||
alias wm64='wmSET WM_ARCH_OPTION=64'
|
||||
alias wm32='wmSET WM_ARCH_OPTION=32'
|
||||
alias wmSP='wmSET WM_PRECISION_OPTION=SP'
|
||||
alias wmDP='wmSET WM_PRECISION_OPTION=DP'
|
||||
|
||||
# clear env
|
||||
alias wmUNSET='. $WM_PROJECT_DIR/etc/config/unset.sh'
|
||||
|
||||
# Toggle wmakeScheduler on/off
|
||||
# - also need to set WM_HOSTS
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
|
||||
alias wmSchedOFF='unset WM_SCHEDULER'
|
||||
|
||||
# Change ParaView version
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
unset foamPV
|
||||
foamPV()
|
||||
{
|
||||
. $WM_PROJECT_DIR/etc/config/paraview.sh ParaView_VERSION=$1
|
||||
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 1>&2
|
||||
}
|
||||
|
||||
|
||||
# Change directory aliases
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias src='cd $FOAM_SRC'
|
||||
alias lib='cd $FOAM_LIBBIN'
|
||||
alias run='cd $FOAM_RUN'
|
||||
alias foam='cd $WM_PROJECT_DIR'
|
||||
alias foamsrc='cd $FOAM_SRC/$WM_PROJECT'
|
||||
alias foamfv='cd $FOAM_SRC/finiteVolume'
|
||||
alias app='cd $FOAM_APP'
|
||||
alias util='cd $FOAM_UTILITIES'
|
||||
alias sol='cd $FOAM_SOLVERS'
|
||||
alias tut='cd $FOAM_TUTORIALS'
|
||||
|
||||
alias foamApps='cd $FOAM_APP'
|
||||
alias foamSol='cd $FOAM_SOLVERS'
|
||||
alias foamTuts='cd $FOAM_TUTORIALS'
|
||||
alias foamUtils='cd $FOAM_UTILITIES'
|
||||
alias foam3rdParty='cd $WM_THIRD_PARTY_DIR'
|
||||
|
||||
if [ -n "$WM_PROJECT_SITE" ]
|
||||
then
|
||||
alias foamSite='cd $WM_PROJECT_SITE'
|
||||
else
|
||||
alias foamSite='cd $WM_PROJECT_INST_DIR/site'
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
54
etc/config/ensight.csh
Normal file
54
etc/config/ensight.csh
Normal file
@ -0,0 +1,54 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/ensight.csh
|
||||
#
|
||||
# Description
|
||||
# Setup file for Ensight
|
||||
# Sourced from OpenFOAM-*/etc/cshrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# fallback value
|
||||
if (! $?CEI_HOME) then
|
||||
setenv CEI_HOME /usr/local/ensight/CEI
|
||||
endif
|
||||
|
||||
if ( -r $CEI_HOME ) then
|
||||
|
||||
# special treatment for 32bit OpenFOAM and 64bit Ensight
|
||||
if ($WM_ARCH == linux && `uname -m` == x86_64) then
|
||||
setenv CEI_ARCH linux_2.6_32
|
||||
endif
|
||||
|
||||
# add to path
|
||||
setenv PATH ${CEI_HOME}/bin:${PATH}
|
||||
|
||||
setenv ENSIGHT9_INPUT dummy
|
||||
setenv ENSIGHT9_READER $FOAM_LIBBIN
|
||||
else
|
||||
unsetenv CEI_HOME
|
||||
endif
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
60
etc/config/ensight.sh
Normal file
60
etc/config/ensight.sh
Normal file
@ -0,0 +1,60 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/ensight.sh
|
||||
#
|
||||
# Description
|
||||
# Setup file for Ensight
|
||||
# Sourced from OpenFOAM-*/etc/bashrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# fallback value
|
||||
if [ ! -d "$CEI_HOME" ]
|
||||
then
|
||||
export CEI_HOME=/usr/local/ensight/CEI
|
||||
fi
|
||||
|
||||
if [ -r $CEI_HOME ]
|
||||
then
|
||||
|
||||
# special treatment for 32bit OpenFOAM and 64bit Ensight
|
||||
if [ "$WM_ARCH" = linux -a `uname -m` = x86_64 ]
|
||||
then
|
||||
export CEI_ARCH=linux_2.6_32
|
||||
fi
|
||||
|
||||
# add to path if required
|
||||
if [ "$CEI_HOME/bin/ensight" != "`which ensight 2>/dev/null`" ]
|
||||
then
|
||||
export PATH=$CEI_HOME/bin:$PATH
|
||||
fi
|
||||
|
||||
export ENSIGHT9_INPUT=dummy
|
||||
export ENSIGHT9_READER=$FOAM_LIBBIN
|
||||
else
|
||||
unset CEI_HOME
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
51
etc/config/example/compiler.csh
Normal file
51
etc/config/example/compiler.csh
Normal file
@ -0,0 +1,51 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/compiler.csh
|
||||
#
|
||||
# Description
|
||||
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.csh
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Modified compiler settings
|
||||
switch ("$WM_COMPILER")
|
||||
case Gcc46:
|
||||
case Gcc46++0x:
|
||||
set gcc_version=gcc-4.6.0
|
||||
set gmp_version=gmp-5.0.1
|
||||
set mpfr_version=mpfr-2.4.2
|
||||
set mpc_version=mpc-0.8.1
|
||||
breaksw
|
||||
case Gcc45:
|
||||
case Gcc45++0x:
|
||||
set gcc_version=gcc-4.5.2
|
||||
set gmp_version=gmp-5.0.1
|
||||
set mpfr_version=mpfr-2.4.2
|
||||
set mpc_version=mpc-0.8.1
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
49
etc/config/example/compiler.sh
Normal file
49
etc/config/example/compiler.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/compiler.sh
|
||||
#
|
||||
# Description
|
||||
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.sh
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Modified compiler settings
|
||||
case "$WM_COMPILER" in
|
||||
Gcc46 | Gcc46++0x)
|
||||
gcc_version=gcc-4.6.0
|
||||
gmp_version=gmp-5.0.1
|
||||
mpfr_version=mpfr-2.4.2
|
||||
mpc_version=mpc-0.8.1
|
||||
;;
|
||||
Gcc45 | Gcc45++0x)
|
||||
gcc_version=gcc-4.5.2
|
||||
gmp_version=gmp-5.0.1
|
||||
mpfr_version=mpfr-2.4.2
|
||||
mpc_version=mpc-0.8.1
|
||||
;;
|
||||
esac
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
36
etc/config/example/openmpi.csh
Normal file
36
etc/config/example/openmpi.csh
Normal file
@ -0,0 +1,36 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/openmpi.csh
|
||||
#
|
||||
# Description
|
||||
# Example of fine tuning openmpi settings for OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.csh
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Modified openmpi settings
|
||||
setenv FOAM_MPI openmpi-1.4.3
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
36
etc/config/example/openmpi.sh
Normal file
36
etc/config/example/openmpi.sh
Normal file
@ -0,0 +1,36 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/openmpi.sh
|
||||
#
|
||||
# Description
|
||||
# Example of fine tuning openmpi settings for OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.sh
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Modified openmpi settings
|
||||
export FOAM_MPI=openmpi-1.4.3
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
46
etc/config/example/paraview.csh
Normal file
46
etc/config/example/paraview.csh
Normal file
@ -0,0 +1,46 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/paraview.csh
|
||||
#
|
||||
# Description
|
||||
# Example of chaining to the standard config/paraview.csh with a
|
||||
# different ParaView_VERSION
|
||||
#
|
||||
# Note
|
||||
# This file could be copied to a user or site location, but should never
|
||||
# replace the default shipped version as this will cause an infinite loop
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Use other (shipped) paraview.csh with a different ParaView_VERSION
|
||||
#
|
||||
|
||||
set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config/paraview.csh`
|
||||
if ( $status == 0 ) source $foamFile ParaView_VERSION=3.12.0
|
||||
|
||||
unset foamFile
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
46
etc/config/example/paraview.sh
Normal file
46
etc/config/example/paraview.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/paraview.sh
|
||||
#
|
||||
# Description
|
||||
# Example of chaining to the standard config/paraview.sh with a
|
||||
# different ParaView_VERSION
|
||||
#
|
||||
# Note
|
||||
# This file could be copied to a user or site location, but should never
|
||||
# replace the default shipped version as this will cause an infinite loop
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Use other (shipped) paraview.sh with a different ParaView_VERSION
|
||||
#
|
||||
|
||||
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config/paraview.sh 2>/dev/null)
|
||||
[ $? -eq 0 ] && . $foamFile ParaView_VERSION=3.12.0
|
||||
|
||||
unset foamFile
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
52
etc/config/example/prefs.csh
Normal file
52
etc/config/example/prefs.csh
Normal file
@ -0,0 +1,52 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/prefs.csh
|
||||
#
|
||||
# Description
|
||||
# Preset variables for the OpenFOAM configuration - C-Shell shell syntax.
|
||||
#
|
||||
# The prefs.csh file will be sourced by the OpenFOAM etc/cshrc when it is
|
||||
# found by foamEtcFile.
|
||||
#
|
||||
# See Also
|
||||
# 'foamEtcFile -help' or 'foamEtcFile -list' for information about the
|
||||
# paths searched
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
## Specify OpenFOAM ThirdParty compiler
|
||||
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# set foamCompiler=ThirdParty
|
||||
|
||||
## Specify compiler type
|
||||
## ~~~~~~~~~~~~~~~~~~~~~
|
||||
#setenv WM_COMPILER Clang
|
||||
|
||||
## Specify system openmpi
|
||||
## ~~~~~~~~~~~~~~~~~~~~~~
|
||||
# setenv WM_MPLIB SYSTEMOPENMPI
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
52
etc/config/example/prefs.sh
Normal file
52
etc/config/example/prefs.sh
Normal file
@ -0,0 +1,52 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/example/prefs.sh
|
||||
#
|
||||
# Description
|
||||
# Preset variables for the OpenFOAM configuration - POSIX shell syntax.
|
||||
#
|
||||
# The prefs.sh file will be sourced by the OpenFOAM etc/bashrc when it is
|
||||
# found by foamEtcFile.
|
||||
#
|
||||
# See Also
|
||||
# 'foamEtcFile -help' or 'foamEtcFile -list' for information about the
|
||||
# paths searched
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
## Specify OpenFOAM ThirdParty compiler
|
||||
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# foamCompiler=ThirdParty
|
||||
|
||||
## Specify compiler type
|
||||
## ~~~~~~~~~~~~~~~~~~~~~
|
||||
#export WM_COMPILER=Clang
|
||||
|
||||
## Specify system openmpi
|
||||
## ~~~~~~~~~~~~~~~~~~~~~~
|
||||
# export WM_MPLIB=SYSTEMOPENMPI
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
41
etc/config/gperftools.sh
Normal file
41
etc/config/gperftools.sh
Normal file
@ -0,0 +1,41 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/gperftools.sh
|
||||
#
|
||||
# Description
|
||||
# Setup file for gperftools binaries libraries.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
version=svn
|
||||
gperftools_install=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
|
||||
|
||||
GPERFTOOLS_VERSION=gperftools-$version
|
||||
GPERFTOOLS_ARCH_PATH=$gperftools_install/$GPERFTOOLS_VERSION
|
||||
|
||||
export PATH=$GPERFTOOLS_ARCH_PATH/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
39
etc/config/metis.sh
Normal file
39
etc/config/metis.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/metis.sh
|
||||
#
|
||||
# Description
|
||||
# Setup file for metis include/libraries.
|
||||
# Sourced during wmake process only.
|
||||
#
|
||||
# Note
|
||||
# A csh version is not needed, since the values here are only sourced
|
||||
# during the wmake process
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
export METIS_VERSION=metis-5.1.0
|
||||
export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$METIS_VERSION
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
136
etc/config/paraview.csh
Normal file
136
etc/config/paraview.csh
Normal file
@ -0,0 +1,136 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/paraview.csh
|
||||
#
|
||||
# Description
|
||||
# Setup file for paraview-[3-4].x
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
|
||||
#
|
||||
# Note
|
||||
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
|
||||
# are required for building plugins
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# clean the PATH
|
||||
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
||||
# determine the cmake to be used
|
||||
unsetenv CMAKE_HOME
|
||||
foreach cmake ( cmake-2.8.12.1 cmake-2.8.8 cmake-2.8.4 cmake-2.8.3 cmake-2.8.1 )
|
||||
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
||||
if ( -r $cmake ) then
|
||||
setenv CMAKE_HOME $cmake
|
||||
setenv PATH ${CMAKE_HOME}/bin:${PATH}
|
||||
break
|
||||
endif
|
||||
end
|
||||
|
||||
#- ParaView version, automatically determine major version:
|
||||
#setenv ParaView_VERSION 3.12.0
|
||||
#setenv ParaView_VERSION 4.0.1
|
||||
setenv ParaView_VERSION 4.1.0
|
||||
setenv ParaView_MAJOR detect
|
||||
|
||||
|
||||
# Evaluate command-line parameters for ParaView
|
||||
while ( $#argv > 0 )
|
||||
switch ($argv[1])
|
||||
case ParaView*=*:
|
||||
# name=value -> setenv name value
|
||||
eval "setenv $argv[1]:s/=/ /"
|
||||
breaksw
|
||||
endsw
|
||||
shift
|
||||
end
|
||||
|
||||
|
||||
# set MAJOR version to correspond to VERSION
|
||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
||||
switch ("$ParaView_VERSION")
|
||||
case "$ParaView_MAJOR".*:
|
||||
# version and major appear to correspond
|
||||
breaksw
|
||||
|
||||
case [0-9]*:
|
||||
# extract major from the version
|
||||
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
|
||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
|
||||
set paraviewInstDir=$WM_THIRD_PARTY_DIR/ParaView-${ParaView_VERSION}
|
||||
set paraviewArchName=ParaView-$ParaView_VERSION
|
||||
|
||||
# Reset the name of the binary install directory for version 3
|
||||
if ( `echo $ParaView_VERSION | sed -e 's/^\([0-9][0-9]*\).*$/\1/'` == 3) then
|
||||
set paraviewArchName=paraview-$ParaView_VERSION
|
||||
endif
|
||||
|
||||
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName
|
||||
|
||||
# set paths if binaries or source are present
|
||||
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
|
||||
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-${ParaView_MAJOR}
|
||||
if (! -r $ParaView_INCLUDE_DIR && -r $ParaView_DIR/include/paraview) then
|
||||
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview
|
||||
endif
|
||||
|
||||
set ParaView_LIB_DIR=${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}
|
||||
if (! -r $ParaView_LIB_DIR && -r ${ParaView_DIR}/lib/paraview) then
|
||||
set ParaView_LIB_DIR=${ParaView_DIR}/lib/paraview
|
||||
endif
|
||||
|
||||
setenv PATH ${ParaView_DIR}/bin:${PATH}
|
||||
setenv LD_LIBRARY_PATH "${ParaView_LIB_DIR}:${LD_LIBRARY_PATH}"
|
||||
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using paraview"
|
||||
echo " ParaView_DIR : $ParaView_DIR"
|
||||
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
|
||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||
endif
|
||||
|
||||
|
||||
# add in python libraries if required
|
||||
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||
if ( -r $paraviewPython ) then
|
||||
if ($?PYTHONPATH) then
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_LIB_DIR
|
||||
else
|
||||
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
|
||||
endif
|
||||
endif
|
||||
else
|
||||
unsetenv PV_PLUGIN_PATH
|
||||
endif
|
||||
|
||||
|
||||
unset cleaned cmake paraviewInstDir paraviewPython
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
150
etc/config/paraview.sh
Normal file
150
etc/config/paraview.sh
Normal file
@ -0,0 +1,150 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/paraview.sh
|
||||
#
|
||||
# Description
|
||||
# Setup file for paraview-[3-4].x
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc or from foamPV alias
|
||||
#
|
||||
# Note
|
||||
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
|
||||
# are required for building plugins
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# clean the PATH
|
||||
cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"` && PATH="$cleaned"
|
||||
|
||||
# determine the cmake to be used
|
||||
unset CMAKE_HOME
|
||||
for cmake in cmake-2.8.12.1 cmake-2.8.8 cmake-2.8.4 cmake-2.8.3 cmake-2.8.1
|
||||
do
|
||||
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
||||
if [ -r $cmake ]
|
||||
then
|
||||
export CMAKE_HOME=$cmake
|
||||
export PATH=$CMAKE_HOME/bin:$PATH
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
#- ParaView version, automatically determine major version
|
||||
#export ParaView_VERSION=3.12.0
|
||||
#export ParaView_VERSION=4.0.1
|
||||
export ParaView_VERSION=4.1.0
|
||||
export ParaView_MAJOR=detect
|
||||
|
||||
|
||||
# Evaluate command-line parameters for ParaView
|
||||
_foamParaviewEval()
|
||||
{
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
ParaView*=*)
|
||||
# name=value -> export name=value
|
||||
eval "export $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# Evaluate command-line parameters
|
||||
_foamParaviewEval $@
|
||||
|
||||
|
||||
# set MAJOR version to correspond to VERSION
|
||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
||||
case "$ParaView_VERSION" in
|
||||
"$ParaView_MAJOR".* )
|
||||
# version and major appear to correspond
|
||||
;;
|
||||
|
||||
[0-9]*)
|
||||
# extract major from the version
|
||||
ParaView_MAJOR=`echo $ParaView_VERSION | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
||||
;;
|
||||
esac
|
||||
export ParaView_VERSION ParaView_MAJOR
|
||||
|
||||
paraviewInstDir=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
|
||||
paraviewArchName=ParaView-$ParaView_VERSION
|
||||
|
||||
# Reset the name of the binary install directory for version 3
|
||||
if [ `echo $ParaView_VERSION | sed -e 's/^\([0-9][0-9]*\).*$/\1/'` -eq 3 ]
|
||||
then
|
||||
paraviewArchName=paraview-$ParaView_VERSION
|
||||
fi
|
||||
|
||||
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName
|
||||
|
||||
# set paths if binaries or source are present
|
||||
if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
|
||||
then
|
||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
|
||||
if [ ! -d $ParaView_INCLUDE_DIR -a -d $ParaView_DIR/include/paraview ]
|
||||
then
|
||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview
|
||||
fi
|
||||
|
||||
ParaView_LIB_DIR=$ParaView_DIR/lib/paraview-$ParaView_MAJOR
|
||||
if [ ! -d $ParaView_LIB_DIR -a -d $ParaView_DIR/lib/paraview ]
|
||||
then
|
||||
ParaView_LIB_DIR=$ParaView_DIR/lib/paraview
|
||||
fi
|
||||
|
||||
export PATH=$ParaView_DIR/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$LD_LIBRARY_PATH
|
||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using paraview"
|
||||
echo " ParaView_DIR : $ParaView_DIR"
|
||||
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
|
||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||
fi
|
||||
|
||||
# add in python libraries if required
|
||||
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||
if [ -r $paraviewPython ]
|
||||
then
|
||||
if [ "$PYTHONPATH" ]
|
||||
then
|
||||
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
|
||||
else
|
||||
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
|
||||
fi
|
||||
fi
|
||||
else
|
||||
unset PV_PLUGIN_PATH
|
||||
fi
|
||||
|
||||
unset _foamParaviewEval
|
||||
unset cleaned cmake paraviewInstDir paraviewPython
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
39
etc/config/scotch.sh
Normal file
39
etc/config/scotch.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# config/scotch.sh
|
||||
#
|
||||
# Description
|
||||
# Setup file for scotch include/libraries.
|
||||
# Sourced during wmake process only.
|
||||
#
|
||||
# Note
|
||||
# A csh version is not needed, since the values here are only sourced
|
||||
# during the wmake process
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
export SCOTCH_VERSION=scotch_6.0.0
|
||||
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
548
etc/config/settings.csh
Normal file
548
etc/config/settings.csh
Normal file
@ -0,0 +1,548 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config/settings.csh
|
||||
#
|
||||
# Description
|
||||
# Startup file for OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# prefix to PATH
|
||||
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
|
||||
# prefix to LD_LIBRARY_PATH
|
||||
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
|
||||
# prefix to MANPATH
|
||||
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Set environment variables according to system type
|
||||
setenv WM_ARCH `uname -s`
|
||||
|
||||
# Default WM_COMPILER_LIB_ARCH for 32bit
|
||||
setenv WM_COMPILER_LIB_ARCH
|
||||
|
||||
switch ($WM_ARCH)
|
||||
case Linux:
|
||||
setenv WM_ARCH linux
|
||||
|
||||
switch (`uname -m`)
|
||||
case i686:
|
||||
breaksw
|
||||
|
||||
case x86_64:
|
||||
switch ($WM_ARCH_OPTION)
|
||||
case 32:
|
||||
setenv WM_COMPILER_ARCH 64
|
||||
setenv WM_CC 'gcc'
|
||||
setenv WM_CXX 'g++'
|
||||
setenv WM_CFLAGS '-m32 -fPIC'
|
||||
setenv WM_CXXFLAGS '-m32 -fPIC'
|
||||
setenv WM_LDFLAGS '-m32'
|
||||
breaksw
|
||||
|
||||
case 64:
|
||||
setenv WM_ARCH linux64
|
||||
setenv WM_COMPILER_LIB_ARCH 64
|
||||
setenv WM_CC 'gcc'
|
||||
setenv WM_CXX 'g++'
|
||||
setenv WM_CFLAGS '-m64 -fPIC'
|
||||
setenv WM_CXXFLAGS '-m64 -fPIC'
|
||||
setenv WM_LDFLAGS '-m64'
|
||||
breaksw
|
||||
|
||||
default:
|
||||
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
|
||||
breaksw
|
||||
|
||||
endsw
|
||||
breaksw
|
||||
|
||||
case ia64:
|
||||
setenv WM_ARCH linuxIA64
|
||||
setenv WM_COMPILER I64
|
||||
breaksw
|
||||
|
||||
case mips64:
|
||||
setenv WM_ARCH SiCortex64
|
||||
setenv WM_MPLIB MPI
|
||||
setenv WM_COMPILER_LIB_ARCH 64
|
||||
setenv WM_CC 'gcc'
|
||||
setenv WM_CXX 'g++'
|
||||
setenv WM_CFLAGS '-mabi=64 -fPIC'
|
||||
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
|
||||
setenv WM_LDFLAGS '-mabi=64 -G0'
|
||||
breaksw
|
||||
|
||||
case ppc64:
|
||||
setenv WM_ARCH linuxPPC64
|
||||
setenv WM_COMPILER_LIB_ARCH 64
|
||||
setenv WM_CC 'gcc'
|
||||
setenv WM_CXX 'g++'
|
||||
setenv WM_CFLAGS '-m64 -fPIC'
|
||||
setenv WM_CXXFLAGS '-m64 -fPIC'
|
||||
setenv WM_LDFLAGS '-m64'
|
||||
breaksw
|
||||
|
||||
default:
|
||||
echo Unknown processor type `uname -m` for Linux
|
||||
breaksw
|
||||
|
||||
endsw
|
||||
breaksw
|
||||
|
||||
case SunOS:
|
||||
setenv WM_ARCH SunOS64
|
||||
setenv WM_MPLIB FJMPI
|
||||
setenv WM_COMPILER_LIB_ARCH 64
|
||||
setenv WM_CC 'gcc'
|
||||
setenv WM_CXX 'g++'
|
||||
setenv WM_CFLAGS '-mabi=64 -fPIC'
|
||||
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
|
||||
setenv WM_LDFLAGS '-mabi=64 -G0'
|
||||
breaksw
|
||||
|
||||
default:
|
||||
echo
|
||||
echo "Your '$WM_ARCH' operating system is not supported by this release"
|
||||
echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.org"
|
||||
echo
|
||||
breaksw
|
||||
|
||||
endsw
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# location of the jobControl directory
|
||||
setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
|
||||
|
||||
# wmake configuration
|
||||
setenv WM_DIR $WM_PROJECT_DIR/wmake
|
||||
setenv WM_LINK_LANGUAGE c++
|
||||
setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
|
||||
|
||||
# base executables/libraries
|
||||
setenv FOAM_APPBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
|
||||
setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# external (ThirdParty) libraries
|
||||
setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# site-specific directory
|
||||
if ( $?WM_PROJECT_SITE ) then
|
||||
set siteDir=$WM_PROJECT_SITE
|
||||
else
|
||||
set siteDir=$WM_PROJECT_INST_DIR/site
|
||||
endif
|
||||
|
||||
# shared site executables/libraries
|
||||
# similar naming convention as ~OpenFOAM expansion
|
||||
setenv FOAM_SITE_APPBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
|
||||
setenv FOAM_SITE_LIBBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# user executables/libraries
|
||||
setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
|
||||
setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# dynamicCode templates
|
||||
# - default location is the "~OpenFOAM/codeTemplates/dynamicCode" expansion
|
||||
# setenv FOAM_CODE_TEMPLATES $WM_PROJECT_DIR/etc/codeTemplates/dynamicCode
|
||||
|
||||
# convenience
|
||||
setenv FOAM_APP $WM_PROJECT_DIR/applications
|
||||
setenv FOAM_SRC $WM_PROJECT_DIR/src
|
||||
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
|
||||
setenv FOAM_UTILITIES $FOAM_APP/utilities
|
||||
setenv FOAM_SOLVERS $FOAM_APP/solvers
|
||||
setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
|
||||
|
||||
# add wmake to the path - not required for runtime only environment
|
||||
if ( -d "${WM_DIR}" ) setenv PATH ${WM_DIR}:${PATH}
|
||||
# add OpenFOAM scripts to the path
|
||||
setenv PATH ${WM_PROJECT_DIR}/bin:${PATH}
|
||||
|
||||
# add site-specific scripts to path - only if they exist
|
||||
if ( -d "$siteDir/bin" ) then # generic
|
||||
_foamAddPath "$siteDir/bin"
|
||||
endif
|
||||
if ( -d "$siteDir/$WM_PROJECT_VERSION/bin" ) then # version-specific
|
||||
_foamAddPath "$siteDir/$WM_PROJECT_VERSION/bin"
|
||||
endif
|
||||
unset siteDir
|
||||
|
||||
_foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
|
||||
# Make sure to pick up dummy versions of external libraries last
|
||||
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_LIBBIN}:${FOAM_LIBBIN}/dummy
|
||||
|
||||
# Compiler settings
|
||||
# ~~~~~~~~~~~~~~~~~
|
||||
unset gcc_version gmp_version mpfr_version mpc_version
|
||||
unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
|
||||
|
||||
|
||||
# Location of compiler installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ( ! $?foamCompiler ) then
|
||||
set foamCompiler=system
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||
echo " foamCompiler not set, using '$foamCompiler'"
|
||||
endif
|
||||
|
||||
switch ("$foamCompiler")
|
||||
case OpenFOAM:
|
||||
case ThirdParty:
|
||||
switch ("$WM_COMPILER")
|
||||
case Gcc:
|
||||
case Gcc++0x:
|
||||
case Gcc48:
|
||||
case Gcc48++0x:
|
||||
set gcc_version=gcc-4.8.2
|
||||
set gmp_version=gmp-5.1.2
|
||||
set mpfr_version=mpfr-3.1.2
|
||||
set mpc_version=mpc-1.0.1
|
||||
breaksw
|
||||
case Gcc49:
|
||||
case Gcc49++0x:
|
||||
set gcc_version=gcc-4.9.0
|
||||
set gmp_version=gmp-5.1.2
|
||||
set mpfr_version=mpfr-3.1.2
|
||||
set mpc_version=mpc-1.0.1
|
||||
breaksw
|
||||
case Clang:
|
||||
# using clang - not gcc
|
||||
setenv WM_CC 'clang'
|
||||
setenv WM_CXX 'clang++'
|
||||
set clang_version=llvm-3.4.2
|
||||
breaksw
|
||||
default:
|
||||
echo
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
|
||||
echo " Please check your settings"
|
||||
echo
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
# optional configuration tweaks:
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/compiler.csh`
|
||||
|
||||
if ( $?gcc_version ) then
|
||||
set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
|
||||
set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
|
||||
set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
|
||||
if ( $?mpc_version ) then
|
||||
set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
|
||||
endif
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
if ( ! -d "$gccDir" ) then
|
||||
echo
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||
echo " Cannot find $gccDir installation."
|
||||
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||
echo " change the 'foamCompiler' setting to 'system'"
|
||||
echo
|
||||
endif
|
||||
|
||||
_foamAddMan $gccDir/man
|
||||
_foamAddPath $gccDir/bin
|
||||
|
||||
# add compiler libraries to run-time environment
|
||||
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
||||
|
||||
# add gmp/mpfr libraries to run-time environment
|
||||
_foamAddLib $gmpDir/lib
|
||||
_foamAddLib $mpfrDir/lib
|
||||
|
||||
# add mpc libraries (not need for older gcc) to run-time environment
|
||||
if ( $?mpc_version ) then
|
||||
_foamAddLib $mpcDir/lib
|
||||
endif
|
||||
|
||||
# used by boost/CGAL:
|
||||
setenv MPFR_ARCH_PATH $mpfrDir
|
||||
setenv GMP_ARCH_PATH $gmpDir
|
||||
endif
|
||||
unset gcc_version gccDir
|
||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||
|
||||
if ( $?clang_version ) then
|
||||
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
if ( ! -d "$clangDir" ) then
|
||||
echo
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||
echo " Cannot find $clangDir installation."
|
||||
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||
echo " change the 'foamCompiler' setting to 'system'"
|
||||
echo
|
||||
endif
|
||||
|
||||
_foamAddMan $clangDir/man
|
||||
_foamAddPath $clangDir/bin
|
||||
endif
|
||||
unset clang_version clangDir
|
||||
|
||||
breaksw
|
||||
|
||||
case system:
|
||||
# okay, use system compiler
|
||||
breaksw
|
||||
|
||||
default:
|
||||
echo "Warn: foamCompiler='$foamCompiler' is unsupported"
|
||||
echo " treating as 'system' instead"
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
|
||||
#
|
||||
# add c++0x flags for external programs
|
||||
#
|
||||
if ( $?WM_CXXFLAGS ) then
|
||||
switch ("$WM_COMPILER")
|
||||
case Gcc*++0x:
|
||||
setenv WM_CXXFLAGS "$WM_CXXFLAGS -std=c++0x"
|
||||
breaksw
|
||||
endsw
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Communications library
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
unsetenv MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN
|
||||
|
||||
switch ("$WM_MPLIB")
|
||||
case SYSTEMOPENMPI:
|
||||
# Use the system installed openmpi, get library directory via mpicc
|
||||
setenv FOAM_MPI openmpi-system
|
||||
|
||||
set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
||||
# include files and libraries.
|
||||
setenv MPI_ARCH_PATH "${libDir:h}"
|
||||
|
||||
_foamAddLib $libDir
|
||||
unset libDir
|
||||
breaksw
|
||||
|
||||
case OPENMPI:
|
||||
setenv FOAM_MPI openmpi-1.6.5
|
||||
# optional configuration tweaks:
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/openmpi.csh`
|
||||
|
||||
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
||||
|
||||
# Tell OpenMPI where to find its install directory
|
||||
setenv OPAL_PREFIX $MPI_ARCH_PATH
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
|
||||
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
_foamAddMan $MPI_ARCH_PATH/share/man
|
||||
breaksw
|
||||
|
||||
case MPICH:
|
||||
setenv FOAM_MPI mpich2-1.1.1p1
|
||||
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$FOAM_MPI
|
||||
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
|
||||
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
_foamAddMan $MPI_ARCH_PATH/share/man
|
||||
breaksw
|
||||
|
||||
case MPICH-GM:
|
||||
setenv FOAM_MPI mpich-gm
|
||||
setenv MPI_ARCH_PATH /opt/mpi
|
||||
setenv MPICH_PATH $MPI_ARCH_PATH
|
||||
setenv GM_LIB_PATH /opt/gm/lib64
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
|
||||
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
_foamAddLib $GM_LIB_PATH
|
||||
breaksw
|
||||
|
||||
case HPMPI:
|
||||
setenv FOAM_MPI hpmpi
|
||||
setenv MPI_HOME /opt/hpmpi
|
||||
setenv MPI_ARCH_PATH $MPI_HOME
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
switch (`uname -m`)
|
||||
case i686:
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
|
||||
breaksw
|
||||
case x86_64:
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
|
||||
breaksw
|
||||
case ia64:
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
|
||||
breaksw
|
||||
default:
|
||||
echo Unknown processor type `uname -m` for Linux
|
||||
breaksw
|
||||
endsw
|
||||
breaksw
|
||||
|
||||
case GAMMA:
|
||||
setenv FOAM_MPI gamma
|
||||
setenv MPI_ARCH_PATH /usr
|
||||
breaksw
|
||||
|
||||
case MPI:
|
||||
setenv FOAM_MPI mpi
|
||||
setenv MPI_ARCH_PATH /opt/mpi
|
||||
breaksw
|
||||
|
||||
case FJMPI:
|
||||
setenv FOAM_MPI fjmpi
|
||||
setenv MPI_ARCH_PATH /opt/FJSVmpi2
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
|
||||
_foamAddLib /opt/FSUNf90/lib/sparcv9
|
||||
_foamAddLib /opt/FJSVpnidt/lib
|
||||
breaksw
|
||||
|
||||
case QSMPI:
|
||||
setenv FOAM_MPI qsmpi
|
||||
setenv MPI_ARCH_PATH /usr/lib/mpi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
breaksw
|
||||
|
||||
case SGIMPI:
|
||||
if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
|
||||
|
||||
if ( ! -d "$MPI_ROOT" ) then
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||
echo " MPI_ROOT not a valid mpt installation directory."
|
||||
echo " Please set MPI_ROOT to the mpt installation directory."
|
||||
echo " (usually done by loading the mpt module)"
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'"
|
||||
endif
|
||||
|
||||
if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
|
||||
setenv MPI_ROOT ${MPI_ROOT:h}
|
||||
endif
|
||||
|
||||
setenv FOAM_MPI ${MPI_ROOT:t}
|
||||
setenv MPI_ARCH_PATH $MPI_ROOT
|
||||
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using SGI MPT:"
|
||||
echo " MPI_ROOT : $MPI_ROOT"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
endif
|
||||
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
breaksw
|
||||
|
||||
case INTELMPI:
|
||||
if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
|
||||
|
||||
if ( ! -d "$MPI_ROOT" ) then
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||
echo " MPI_ROOT not a valid mpt installation directory."
|
||||
echo " Please set MPI_ROOT to the mpt installation directory."
|
||||
echo " (usually done by loading the mpt module)"
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'"
|
||||
endif
|
||||
|
||||
if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
|
||||
setenv MPI_ROOT ${MPI_ROOT:h}
|
||||
endif
|
||||
|
||||
setenv FOAM_MPI ${MPI_ROOT:t}
|
||||
setenv MPI_ARCH_PATH $MPI_ROOT
|
||||
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using INTEL MPT:"
|
||||
echo " MPI_ROOT : $MPI_ROOT"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
endif
|
||||
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin64
|
||||
_foamAddLib $MPI_ARCH_PATH/lib64
|
||||
breaksw
|
||||
|
||||
default:
|
||||
setenv FOAM_MPI dummy
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
|
||||
# add (non-dummy) MPI implementation
|
||||
# dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
|
||||
if ( "$FOAM_MPI" != dummy ) then
|
||||
_foamAddLib ${FOAM_LIBBIN}/${FOAM_MPI}:${FOAM_EXT_LIBBIN}/${FOAM_MPI}
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ( ! $?minBufferSize ) set minBufferSize=20000000
|
||||
|
||||
if ( $?MPI_BUFFER_SIZE ) then
|
||||
if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
|
||||
setenv MPI_BUFFER_SIZE $minBufferSize
|
||||
endif
|
||||
else
|
||||
setenv MPI_BUFFER_SIZE $minBufferSize
|
||||
endif
|
||||
|
||||
|
||||
# cleanup environment:
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
#- keep _foamAddPath _foamAddLib _foamAddMan
|
||||
unset minBufferSize
|
||||
unsetenv foamCompiler
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
557
etc/config/settings.sh
Normal file
557
etc/config/settings.sh
Normal file
@ -0,0 +1,557 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config/settings.sh
|
||||
#
|
||||
# Description
|
||||
# Startup file for OpenFOAM
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# prefix to PATH
|
||||
_foamAddPath()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
export PATH=$1:$PATH
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# prefix to LD_LIBRARY_PATH
|
||||
_foamAddLib()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# prefix to MANPATH
|
||||
_foamAddMan()
|
||||
{
|
||||
while [ $# -ge 1 ]
|
||||
do
|
||||
export MANPATH=$1:$MANPATH
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Set environment variables according to system type
|
||||
export WM_ARCH=`uname -s`
|
||||
|
||||
case "$WM_ARCH" in
|
||||
Linux)
|
||||
WM_ARCH=linux
|
||||
|
||||
# compiler specifics
|
||||
case `uname -m` in
|
||||
i686)
|
||||
;;
|
||||
|
||||
x86_64)
|
||||
case "$WM_ARCH_OPTION" in
|
||||
32)
|
||||
export WM_COMPILER_ARCH=64
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-m32 -fPIC'
|
||||
export WM_CXXFLAGS='-m32 -fPIC'
|
||||
export WM_LDFLAGS='-m32'
|
||||
;;
|
||||
64)
|
||||
WM_ARCH=linux64
|
||||
export WM_COMPILER_LIB_ARCH=64
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-m64 -fPIC'
|
||||
export WM_CXXFLAGS='-m64 -fPIC'
|
||||
export WM_LDFLAGS='-m64'
|
||||
;;
|
||||
*)
|
||||
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64" 1>&2
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
ia64)
|
||||
WM_ARCH=linuxIA64
|
||||
export WM_COMPILER=I64
|
||||
;;
|
||||
|
||||
mips64)
|
||||
WM_ARCH=SiCortex64
|
||||
WM_MPLIB=MPI
|
||||
export WM_COMPILER_LIB_ARCH=64
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-mabi=64 -fPIC'
|
||||
export WM_CXXFLAGS='-mabi=64 -fPIC'
|
||||
export WM_LDFLAGS='-mabi=64 -G0'
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
WM_ARCH=linuxARM7
|
||||
export WM_COMPILER_LIB_ARCH=32
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-fPIC'
|
||||
export WM_CXXFLAGS='-fPIC'
|
||||
export WM_LDFLAGS=
|
||||
;;
|
||||
|
||||
ppc64)
|
||||
WM_ARCH=linuxPPC64
|
||||
export WM_COMPILER_LIB_ARCH=64
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-m64 -fPIC'
|
||||
export WM_CXXFLAGS='-m64 -fPIC'
|
||||
export WM_LDFLAGS='-m64'
|
||||
;;
|
||||
|
||||
*)
|
||||
echo Unknown processor type `uname -m` for Linux 1>&2
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
SunOS)
|
||||
WM_ARCH=SunOS64
|
||||
WM_MPLIB=FJMPI
|
||||
export WM_COMPILER_LIB_ARCH=64
|
||||
export WM_CC='gcc'
|
||||
export WM_CXX='g++'
|
||||
export WM_CFLAGS='-mabi=64 -fPIC'
|
||||
export WM_CXXFLAGS='-mabi=64 -fPIC'
|
||||
export WM_LDFLAGS='-mabi=64 -G0'
|
||||
;;
|
||||
|
||||
*) # an unsupported operating system
|
||||
/bin/cat <<USAGE 1>&2
|
||||
|
||||
Your "$WM_ARCH" operating system is not supported by this release
|
||||
of OpenFOAM. For further assistance, please contact www.OpenFOAM.org
|
||||
|
||||
USAGE
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# location of the jobControl directory
|
||||
export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
|
||||
|
||||
# wmake configuration
|
||||
export WM_DIR=$WM_PROJECT_DIR/wmake
|
||||
export WM_LINK_LANGUAGE=c++
|
||||
export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
|
||||
|
||||
# base executables/libraries
|
||||
export FOAM_APPBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
|
||||
export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# external (ThirdParty) libraries
|
||||
export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# site-specific directory
|
||||
siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}"
|
||||
|
||||
# shared site executables/libraries
|
||||
# similar naming convention as ~OpenFOAM expansion
|
||||
export FOAM_SITE_APPBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
|
||||
export FOAM_SITE_LIBBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# user executables/libraries
|
||||
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
|
||||
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
|
||||
|
||||
# dynamicCode templates
|
||||
# - default location is the "~OpenFOAM/codeTemplates/dynamicCode" expansion
|
||||
# export FOAM_CODE_TEMPLATES=$WM_PROJECT_DIR/etc/codeTemplates/dynamicCode
|
||||
|
||||
# convenience
|
||||
export FOAM_APP=$WM_PROJECT_DIR/applications
|
||||
export FOAM_SRC=$WM_PROJECT_DIR/src
|
||||
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
|
||||
export FOAM_UTILITIES=$FOAM_APP/utilities
|
||||
export FOAM_SOLVERS=$FOAM_APP/solvers
|
||||
export FOAM_RUN=$WM_PROJECT_USER_DIR/run
|
||||
|
||||
# add wmake to the path - not required for runtime only environment
|
||||
[ -d "$WM_DIR" ] && PATH=$WM_DIR:$PATH
|
||||
# add OpenFOAM scripts to the path
|
||||
export PATH=$WM_PROJECT_DIR/bin:$PATH
|
||||
|
||||
# add site-specific scripts to path - only if they exist
|
||||
if [ -d "$siteDir/bin" ] # generic
|
||||
then
|
||||
_foamAddPath "$siteDir/bin"
|
||||
fi
|
||||
if [ -d "$siteDir/$WM_PROJECT_VERSION/bin" ] # version-specific
|
||||
then
|
||||
_foamAddPath "$siteDir/$WM_PROJECT_VERSION/bin"
|
||||
fi
|
||||
unset siteDir
|
||||
|
||||
_foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
|
||||
# Make sure to pick up dummy versions of external libraries last
|
||||
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$FOAM_LIBBIN/dummy
|
||||
|
||||
# Compiler settings
|
||||
# ~~~~~~~~~~~~~~~~~
|
||||
unset gcc_version gmp_version mpfr_version mpc_version
|
||||
unset MPFR_ARCH_PATH GMP_ARCH_PATH
|
||||
|
||||
# Location of compiler installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if [ -z "$foamCompiler" ]
|
||||
then
|
||||
foamCompiler=system
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||
echo " foamCompiler not set, using '$foamCompiler'" 1>&2
|
||||
fi
|
||||
|
||||
case "${foamCompiler}" in
|
||||
OpenFOAM | ThirdParty)
|
||||
case "$WM_COMPILER" in
|
||||
Gcc | Gcc++0x | Gcc48 | Gcc48++0x)
|
||||
gcc_version=gcc-4.8.2
|
||||
gmp_version=gmp-5.1.2
|
||||
mpfr_version=mpfr-3.1.2
|
||||
mpc_version=mpc-1.0.1
|
||||
;;
|
||||
Gcc49 | Gcc49++0x)
|
||||
gcc_version=gcc-4.9.0
|
||||
gmp_version=gmp-5.1.2
|
||||
mpfr_version=mpfr-3.1.2
|
||||
mpc_version=mpc-1.0.1
|
||||
;;
|
||||
Clang)
|
||||
# using clang - not gcc
|
||||
export WM_CC='clang'
|
||||
export WM_CXX='clang++'
|
||||
clang_version=llvm-3.4.2
|
||||
;;
|
||||
*)
|
||||
echo 1>&2
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" 1>&2
|
||||
echo " Please check your settings" 1>&2
|
||||
echo 1>&2
|
||||
;;
|
||||
esac
|
||||
|
||||
# optional configuration tweaks:
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/compiler.sh`
|
||||
|
||||
if [ -n "$gcc_version" ]
|
||||
then
|
||||
gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
|
||||
gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
|
||||
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
|
||||
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
[ -d "$gccDir" ] || {
|
||||
echo 1>&2
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||
echo " Cannot find $gccDir installation." 1>&2
|
||||
echo " Please install this compiler version or if you wish to use the system compiler," 1>&2
|
||||
echo " change the 'foamCompiler' setting to 'system'" 1>&2
|
||||
echo
|
||||
}
|
||||
|
||||
_foamAddMan $gccDir/man
|
||||
_foamAddPath $gccDir/bin
|
||||
|
||||
# add compiler libraries to run-time environment
|
||||
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
||||
|
||||
# add gmp/mpfr libraries to run-time environment
|
||||
_foamAddLib $gmpDir/lib
|
||||
_foamAddLib $mpfrDir/lib
|
||||
|
||||
# add mpc libraries (not need for older gcc) to run-time environment
|
||||
if [ -n "$mpc_version" ]
|
||||
then
|
||||
_foamAddLib $mpcDir/lib
|
||||
fi
|
||||
|
||||
# used by boost/CGAL:
|
||||
export MPFR_ARCH_PATH=$mpfrDir
|
||||
export GMP_ARCH_PATH=$gmpDir
|
||||
fi
|
||||
unset gcc_version gccDir
|
||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||
|
||||
if [ -n "$clang_version" ]
|
||||
then
|
||||
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
[ -d "$clangDir" ] || {
|
||||
echo 1>&2
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||
echo " Cannot find $clangDir installation." 1>&2
|
||||
echo " Please install this compiler version or if you wish to use the system compiler," 1>&2
|
||||
echo " change the 'foamCompiler' setting to 'system'" 1>&2
|
||||
echo 1>&2
|
||||
}
|
||||
|
||||
_foamAddMan $clangDir/share/man
|
||||
_foamAddPath $clangDir/bin
|
||||
fi
|
||||
unset clang_version clangDir
|
||||
;;
|
||||
system)
|
||||
# okay, use system compiler
|
||||
;;
|
||||
*)
|
||||
echo "Warn: foamCompiler='$foamCompiler' is unsupported" 1>&2
|
||||
echo " treating as 'system' instead" 1>&2
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# add c++0x flags for external programs
|
||||
#
|
||||
if [ -n "$WM_CXXFLAGS" ]
|
||||
then
|
||||
case "$WM_COMPILER" in
|
||||
Gcc*++0x)
|
||||
WM_CXXFLAGS="$WM_CXXFLAGS -std=c++0x"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Communications library
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
unset MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN
|
||||
|
||||
case "$WM_MPLIB" in
|
||||
SYSTEMOPENMPI)
|
||||
# Use the system installed openmpi, get library directory via mpicc
|
||||
export FOAM_MPI=openmpi-system
|
||||
|
||||
libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
||||
# include files and libraries.
|
||||
export MPI_ARCH_PATH="${libDir%/*}"
|
||||
|
||||
_foamAddLib $libDir
|
||||
unset libDir
|
||||
;;
|
||||
|
||||
OPENMPI)
|
||||
export FOAM_MPI=openmpi-1.6.5
|
||||
# optional configuration tweaks:
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/openmpi.sh`
|
||||
|
||||
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
||||
|
||||
# Tell OpenMPI where to find its install directory
|
||||
export OPAL_PREFIX=$MPI_ARCH_PATH
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
|
||||
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
_foamAddMan $MPI_ARCH_PATH/share/man
|
||||
;;
|
||||
|
||||
MPICH)
|
||||
export FOAM_MPI=mpich2-1.1.1p1
|
||||
export MPI_HOME=$WM_THIRD_PARTY_DIR/$FOAM_MPI
|
||||
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
|
||||
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
_foamAddMan $MPI_ARCH_PATH/share/man
|
||||
;;
|
||||
|
||||
MPICH-GM)
|
||||
export FOAM_MPI=mpich-gm
|
||||
export MPI_ARCH_PATH=/opt/mpi
|
||||
export MPICH_PATH=$MPI_ARCH_PATH
|
||||
export GM_LIB_PATH=/opt/gm/lib64
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
# 64-bit on OpenSuSE 12.1 uses lib64 others use lib
|
||||
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
|
||||
_foamAddLib $GM_LIB_PATH
|
||||
;;
|
||||
|
||||
HPMPI)
|
||||
export FOAM_MPI=hpmpi
|
||||
export MPI_HOME=/opt/hpmpi
|
||||
export MPI_ARCH_PATH=$MPI_HOME
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
|
||||
case `uname -m` in
|
||||
i686)
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
|
||||
;;
|
||||
|
||||
x86_64)
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
|
||||
;;
|
||||
ia64)
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
|
||||
;;
|
||||
*)
|
||||
echo Unknown processor type `uname -m` 1>&2
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
GAMMA)
|
||||
export FOAM_MPI=gamma
|
||||
export MPI_ARCH_PATH=/usr
|
||||
;;
|
||||
|
||||
MPI)
|
||||
export FOAM_MPI=mpi
|
||||
export MPI_ARCH_PATH=/opt/mpi
|
||||
;;
|
||||
|
||||
FJMPI)
|
||||
export FOAM_MPI=fjmpi
|
||||
export MPI_ARCH_PATH=/opt/FJSVmpi2
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
|
||||
_foamAddLib /opt/FSUNf90/lib/sparcv9
|
||||
_foamAddLib /opt/FJSVpnidt/lib
|
||||
;;
|
||||
|
||||
QSMPI)
|
||||
export FOAM_MPI=qsmpi
|
||||
export MPI_ARCH_PATH=/usr/lib/mpi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
;;
|
||||
|
||||
SGIMPI)
|
||||
# no trailing slash
|
||||
[ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}"
|
||||
|
||||
export FOAM_MPI="${MPI_ROOT##*/}"
|
||||
export MPI_ARCH_PATH=$MPI_ROOT
|
||||
|
||||
if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||
echo " MPI_ROOT not a valid mpt installation directory or ending in a '/'." 1>&2
|
||||
echo " Please set MPI_ROOT to the mpt installation directory." 1>&2
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'" 1>&2
|
||||
fi
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using SGI MPT:" 1>&2
|
||||
echo " MPI_ROOT : $MPI_ROOT" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
fi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
_foamAddLib $MPI_ARCH_PATH/lib
|
||||
;;
|
||||
|
||||
INTELMPI)
|
||||
# no trailing slash
|
||||
[ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}"
|
||||
|
||||
export FOAM_MPI="${MPI_ROOT##*/}"
|
||||
export MPI_ARCH_PATH=$MPI_ROOT
|
||||
|
||||
if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||
echo " MPI_ROOT not a valid mpt installation directory or ending in a '/'." 1>&2
|
||||
echo " Please set MPI_ROOT to the mpt installation directory." 1>&2
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'" 1>&2
|
||||
fi
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using INTEL MPI:" 1>&2
|
||||
echo " MPI_ROOT : $MPI_ROOT" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
fi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin64
|
||||
_foamAddLib $MPI_ARCH_PATH/lib64
|
||||
;;
|
||||
*)
|
||||
export FOAM_MPI=dummy
|
||||
;;
|
||||
esac
|
||||
|
||||
# add (non-dummy) MPI implementation
|
||||
# dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
|
||||
if [ "$FOAM_MPI" != dummy ]
|
||||
then
|
||||
_foamAddLib $FOAM_LIBBIN/$FOAM_MPI:$FOAM_EXT_LIBBIN/$FOAM_MPI
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
: ${minBufferSize:=20000000}
|
||||
|
||||
if [ "${MPI_BUFFER_SIZE:=$minBufferSize}" -lt $minBufferSize ]
|
||||
then
|
||||
MPI_BUFFER_SIZE=$minBufferSize
|
||||
fi
|
||||
export MPI_BUFFER_SIZE
|
||||
|
||||
|
||||
# cleanup environment:
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
#keep _foamAddPath _foamAddLib _foamAddMan
|
||||
unset foamCompiler minBufferSize
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
194
etc/config/unset.csh
Normal file
194
etc/config/unset.csh
Normal file
@ -0,0 +1,194 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config/unset.csh
|
||||
#
|
||||
# Description
|
||||
# Clear as many OpenFOAM environment settings as possible
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
|
||||
|
||||
unset foamClean
|
||||
if ( $?WM_PROJECT_DIR ) then
|
||||
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
||||
if ( ! -f "$foamClean" || ! -x "$foamClean" ) unset foamClean
|
||||
endif
|
||||
|
||||
set foamOldDirs=""
|
||||
|
||||
# The old dirs to be cleaned from the various environment variables
|
||||
# - remove anything under top-level directory.
|
||||
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
|
||||
#
|
||||
if ( $?WM_PROJECT_INST_DIR ) then
|
||||
set foamOldDirs="$WM_PROJECT_INST_DIR"
|
||||
endif
|
||||
|
||||
if ( $?WM_PROJECT ) then
|
||||
set foamOldDirs="$HOME/$WM_PROJECT/$LOGNAME $foamOldDirs"
|
||||
endif
|
||||
|
||||
if ( $?WM_PROJECT_SITE ) then
|
||||
set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
|
||||
endif
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset WM_* environment variables
|
||||
|
||||
unsetenv WM_ARCH
|
||||
unsetenv WM_ARCH_OPTION
|
||||
unsetenv WM_CC
|
||||
unsetenv WM_CFLAGS
|
||||
unsetenv WM_COMPILER
|
||||
unsetenv WM_COMPILER_LIB_ARCH
|
||||
unsetenv WM_COMPILE_OPTION
|
||||
unsetenv WM_CXX
|
||||
unsetenv WM_CXXFLAGS
|
||||
unsetenv WM_DIR
|
||||
unsetenv WM_HOSTS
|
||||
unsetenv WM_LDFLAGS
|
||||
unsetenv WM_LINK_LANGUAGE
|
||||
unsetenv WM_MPLIB
|
||||
unsetenv WM_NCOMPPROCS
|
||||
unsetenv WM_OPTIONS
|
||||
unsetenv WM_OSTYPE
|
||||
unsetenv WM_PRECISION_OPTION
|
||||
unsetenv WM_PROJECT
|
||||
unsetenv WM_PROJECT_DIR
|
||||
unsetenv WM_PROJECT_INST_DIR
|
||||
unsetenv WM_PROJECT_SITE
|
||||
unsetenv WM_PROJECT_USER_DIR
|
||||
unsetenv WM_PROJECT_VERSION
|
||||
unsetenv WM_SCHEDULER
|
||||
unsetenv WM_THIRD_PARTY_DIR
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset FOAM_* environment variables
|
||||
|
||||
unsetenv FOAM_APPBIN
|
||||
unsetenv FOAM_APP
|
||||
unsetenv FOAM_EXT_LIBBIN
|
||||
unsetenv FOAM_CODE_TEMPLATES
|
||||
unsetenv FOAM_INST_DIR
|
||||
unsetenv FOAM_JOB_DIR
|
||||
unsetenv FOAM_LIBBIN
|
||||
unsetenv FOAM_MPI
|
||||
unsetenv FOAM_RUN
|
||||
unsetenv FOAM_SETTINGS
|
||||
unsetenv FOAM_SIGFPE
|
||||
unsetenv FOAM_SIGNAN
|
||||
unsetenv FOAM_SITE_APPBIN
|
||||
unsetenv FOAM_SITE_LIBBIN
|
||||
unsetenv FOAM_SOLVERS
|
||||
unsetenv FOAM_SRC
|
||||
unsetenv FOAM_TUTORIALS
|
||||
unsetenv FOAM_USER_APPBIN
|
||||
unsetenv FOAM_USER_LIBBIN
|
||||
unsetenv FOAM_UTILITIES
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset MPI-related environment variables
|
||||
|
||||
unsetenv MPI_ARCH_PATH
|
||||
unsetenv MPI_BUFFER_SIZE
|
||||
unsetenv OPAL_PREFIX
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset Ensight/ParaView-related environment variables
|
||||
|
||||
unsetenv ENSIGHT9_READER
|
||||
unsetenv CMAKE_HOME
|
||||
unsetenv ParaView_DIR
|
||||
unsetenv ParaView_INCLUDE_DIR
|
||||
unsetenv PV_PLUGIN_PATH
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# cleanup environment
|
||||
# PATH, LD_LIBRARY_PATH, MANPATH
|
||||
|
||||
if ( $?foamClean ) then
|
||||
|
||||
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
||||
if ($?LD_LIBRARY_PATH) then
|
||||
set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
|
||||
|
||||
if ( ${%LD_LIBRARY_PATH} == 0 ) unsetenv LD_LIBRARY_PATH
|
||||
endif
|
||||
|
||||
if ($?MANPATH) then
|
||||
set cleaned=`$foamClean "$MANPATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv MANPATH $cleaned
|
||||
|
||||
if ( ${%MANPATH} == 0 ) unsetenv MANPATH
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
unset cleaned foamClean foamOldDirs
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# cleanup aliases
|
||||
|
||||
unalias wmSET
|
||||
unalias wm64
|
||||
unalias wm32
|
||||
unalias wmSP
|
||||
unalias wmDP
|
||||
|
||||
unalias wmUNSET
|
||||
|
||||
unalias wmSchedON
|
||||
unalias wmSchedOFF
|
||||
unalias foamPV
|
||||
|
||||
unalias src
|
||||
unalias lib
|
||||
unalias run
|
||||
unalias foam
|
||||
unalias foamsrc
|
||||
unalias foamfv
|
||||
unalias app
|
||||
unalias util
|
||||
unalias sol
|
||||
unalias tut
|
||||
|
||||
unalias foamApps
|
||||
unalias foamSol
|
||||
unalias foamTuts
|
||||
unalias foamUtils
|
||||
unalias foam3rdParty
|
||||
unalias foamSite
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
173
etc/config/unset.sh
Normal file
173
etc/config/unset.sh
Normal file
@ -0,0 +1,173 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/config/unset.sh
|
||||
#
|
||||
# Description
|
||||
# Clear as many OpenFOAM environment settings as possible
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
|
||||
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
||||
[ -f "$foamClean" -a -x "$foamClean" ] || unset foamClean
|
||||
|
||||
# The old dirs to be cleaned from the various environment variables
|
||||
# - remove anything under top-level directory.
|
||||
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
|
||||
#
|
||||
foamOldDirs="$WM_PROJECT_INST_DIR $WM_PROJECT_SITE"
|
||||
if [ -n "$WM_PROJECT" ]
|
||||
then
|
||||
foamOldDirs="$foamOldDirs $HOME/$WM_PROJECT/$USER_SITE"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset WM_* environment variables
|
||||
|
||||
unset WM_ARCH
|
||||
unset WM_ARCH_OPTION
|
||||
unset WM_CC
|
||||
unset WM_CFLAGS
|
||||
unset WM_COMPILER
|
||||
unset WM_COMPILER_LIB_ARCH
|
||||
unset WM_COMPILE_OPTION
|
||||
unset WM_CXX
|
||||
unset WM_CXXFLAGS
|
||||
unset WM_DIR
|
||||
unset WM_HOSTS
|
||||
unset WM_LDFLAGS
|
||||
unset WM_LINK_LANGUAGE
|
||||
unset WM_MPLIB
|
||||
unset WM_NCOMPPROCS
|
||||
unset WM_OPTIONS
|
||||
unset WM_OSTYPE
|
||||
unset WM_PRECISION_OPTION
|
||||
unset WM_PROJECT
|
||||
unset WM_PROJECT_DIR
|
||||
unset WM_PROJECT_INST_DIR
|
||||
unset WM_PROJECT_SITE
|
||||
unset WM_PROJECT_USER_DIR
|
||||
unset WM_PROJECT_VERSION
|
||||
unset WM_SCHEDULER
|
||||
unset WM_THIRD_PARTY_DIR
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset FOAM_* environment variables
|
||||
|
||||
unset FOAM_APPBIN
|
||||
unset FOAM_APP
|
||||
unset FOAM_EXT_LIBBIN
|
||||
unset FOAM_CODE_TEMPLATES
|
||||
unset FOAM_INST_DIR
|
||||
unset FOAM_JOB_DIR
|
||||
unset FOAM_LIBBIN
|
||||
unset FOAM_MPI
|
||||
unset FOAM_RUN
|
||||
unset FOAM_SETTINGS
|
||||
unset FOAM_SIGFPE
|
||||
unset FOAM_SIGNAN
|
||||
unset FOAM_SITE_APPBIN
|
||||
unset FOAM_SITE_LIBBIN
|
||||
unset FOAM_SOLVERS
|
||||
unset FOAM_SRC
|
||||
unset FOAM_TUTORIALS
|
||||
unset FOAM_USER_APPBIN
|
||||
unset FOAM_USER_LIBBIN
|
||||
unset FOAM_UTILITIES
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset MPI-related environment variables
|
||||
|
||||
unset MPI_ARCH_PATH
|
||||
unset MPI_BUFFER_SIZE
|
||||
unset OPAL_PREFIX
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# unset Ensight/ParaView-related environment variables
|
||||
|
||||
unset ENSIGHT9_READER
|
||||
unset CMAKE_HOME
|
||||
unset ParaView_DIR
|
||||
unset ParaView_INCLUDE_DIR
|
||||
unset PV_PLUGIN_PATH
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# cleanup environment
|
||||
# PATH, LD_LIBRARY_PATH, MANPATH
|
||||
|
||||
if [ -n "$foamClean" ]
|
||||
then
|
||||
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
|
||||
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleaned"
|
||||
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
|
||||
fi
|
||||
|
||||
|
||||
[ -n "$LD_LIBRARY_PATH" ] || unset LD_LIBRARY_PATH
|
||||
[ -n "$MANPATH" ] || unset MANPATH
|
||||
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
|
||||
|
||||
|
||||
unset cleaned foamClean foamOldDirs
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# cleanup aliases
|
||||
|
||||
unalias wmSET
|
||||
unalias wm64
|
||||
unalias wm32
|
||||
unalias wmSP
|
||||
unalias wmDP
|
||||
|
||||
unalias wmUNSET
|
||||
|
||||
unalias wmSchedON
|
||||
unalias wmSchedOFF
|
||||
unset foamPV
|
||||
|
||||
unalias src
|
||||
unalias lib
|
||||
unalias run
|
||||
unalias foam
|
||||
unalias foamsrc
|
||||
unalias foamfv
|
||||
unalias app
|
||||
unalias util
|
||||
unalias sol
|
||||
unalias tut
|
||||
|
||||
unalias foamApps
|
||||
unalias foamSol
|
||||
unalias foamTuts
|
||||
unalias foamUtils
|
||||
unalias foam3rdParty
|
||||
unalias foamSite
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
1032
etc/controlDict
Normal file
1032
etc/controlDict
Normal file
File diff suppressed because it is too large
Load Diff
234
etc/cshrc
Normal file
234
etc/cshrc
Normal file
@ -0,0 +1,234 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File
|
||||
# etc/cshrc
|
||||
#
|
||||
# Description
|
||||
# Startup file for OpenFOAM
|
||||
# Sourced from ~/.login or ~/.cshrc
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
setenv WM_PROJECT OpenFOAM
|
||||
setenv WM_PROJECT_VERSION dev
|
||||
|
||||
################################################################################
|
||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||
#
|
||||
# either setenv FOAM_INST_DIR before sourcing this file or set
|
||||
# 'foamInstall' below to where OpenFOAM is installed
|
||||
#
|
||||
# Location of the OpenFOAM installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
set foamInstall = $HOME/$WM_PROJECT
|
||||
# set foamInstall = ~$WM_PROJECT
|
||||
# set foamInstall = /opt/$WM_PROJECT
|
||||
# set foamInstall = /usr/local/$WM_PROJECT
|
||||
#
|
||||
# END OF (NORMAL) USER EDITABLE PART
|
||||
################################################################################
|
||||
|
||||
#
|
||||
# These are the defaults for this version which should generally be
|
||||
# overridden from the prefs.csh file or from command-line specification
|
||||
#
|
||||
#- note the location for later use (eg, in job scripts)
|
||||
if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
|
||||
|
||||
#- Compiler location:
|
||||
# foamCompiler = system | ThirdParty (OpenFOAM)
|
||||
setenv foamCompiler system
|
||||
|
||||
#- Compiler:
|
||||
# WM_COMPILER = Gcc | Gcc45 | Gcc46 | Gcc47 | Clang | Icc (Intel icc)
|
||||
setenv WM_COMPILER Gcc
|
||||
setenv WM_COMPILER_ARCH # defined but empty
|
||||
unsetenv WM_COMPILER_LIB_ARCH
|
||||
|
||||
#- Architecture:
|
||||
# WM_ARCH_OPTION = 32 | 64
|
||||
setenv WM_ARCH_OPTION 64
|
||||
|
||||
#- Precision:
|
||||
# WM_PRECISION_OPTION = DP | SP
|
||||
setenv WM_PRECISION_OPTION DP
|
||||
|
||||
#- Optimised, debug, profiling:
|
||||
# WM_COMPILE_OPTION = Opt | Debug | Prof
|
||||
setenv WM_COMPILE_OPTION Opt
|
||||
|
||||
#- MPI implementation:
|
||||
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
|
||||
# | GAMMA | MPI | QSMPI | SGIMPI
|
||||
setenv WM_MPLIB SYSTEMOPENMPI
|
||||
|
||||
#- Operating System:
|
||||
# WM_OSTYPE = POSIX | ???
|
||||
setenv WM_OSTYPE POSIX
|
||||
|
||||
#- Floating-point signal handling:
|
||||
# set or unset
|
||||
setenv FOAM_SIGFPE
|
||||
|
||||
#- memory initialisation:
|
||||
# set or unset
|
||||
#setenv FOAM_SETNAN
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
# The old dirs to be cleaned from the various environment variables
|
||||
# - remove anything under top-level directory.
|
||||
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
|
||||
set foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME"
|
||||
if ( $?WM_PROJECT_INST_DIR ) then
|
||||
if ( "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ) then
|
||||
set foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# Location of installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
|
||||
setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of third-party software
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
||||
|
||||
# Location of site-specific templates etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
||||
if ( $?WM_PROJECT_SITE ) then
|
||||
set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
|
||||
if ( ! -d "$WM_PROJECT_SITE" ) unsetenv WM_PROJECT_SITE
|
||||
else
|
||||
unsetenv WM_PROJECT_SITE
|
||||
endif
|
||||
|
||||
# Location of user files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
|
||||
|
||||
|
||||
# Source files, possibly with some verbosity
|
||||
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
|
||||
|
||||
# Add in preset user or site preferences:
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
||||
|
||||
# Evaluate command-line parameters and record settings for later
|
||||
# these can be used to set/unset values, or specify alternative pref files
|
||||
setenv FOAM_SETTINGS "${*}"
|
||||
while ( $#argv > 0 )
|
||||
switch ($argv[1])
|
||||
case -*:
|
||||
# stray option (not meant for us here) -> get out
|
||||
break
|
||||
breaksw
|
||||
case *=:
|
||||
# name= -> unsetenv name
|
||||
if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $argv[1]:s/=//"
|
||||
eval "unsetenv $argv[1]:s/=//"
|
||||
breaksw
|
||||
case *=*:
|
||||
# name=value -> setenv name value
|
||||
if ($?FOAM_VERBOSE && $?prompt) echo "setenv $argv[1]:s/=/ /"
|
||||
eval "setenv $argv[1]:s/=/ /"
|
||||
breaksw
|
||||
default:
|
||||
# filename: source it
|
||||
if ( -f "$1" ) then
|
||||
_foamSource "$1"
|
||||
else
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
|
||||
endif
|
||||
breaksw
|
||||
endsw
|
||||
shift
|
||||
end
|
||||
|
||||
|
||||
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
||||
|
||||
#- prevent local variables from shadowing setenv variables
|
||||
unset PATH MANPATH LD_LIBRARY_PATH LD_PRELOAD
|
||||
|
||||
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH ''
|
||||
if (! $?MANPATH) setenv MANPATH ''
|
||||
|
||||
#- Clean PATH (path)
|
||||
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
||||
#- Clean LD_LIBRARY_PATH
|
||||
set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
|
||||
|
||||
#- Clean MANPATH
|
||||
set cleaned=`$foamClean "$MANPATH" "$foamOldDirs"`
|
||||
if ( $status == 0 ) setenv MANPATH $cleaned
|
||||
|
||||
|
||||
# Source project setup files
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamSource $WM_PROJECT_DIR/etc/config/settings.csh
|
||||
_foamSource $WM_PROJECT_DIR/etc/config/aliases.csh
|
||||
|
||||
# Source user setup files for optional packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.csh`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.csh`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.csh`
|
||||
|
||||
|
||||
# Clean environment paths again. Only remove duplicates
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#- Clean PATH (path)
|
||||
set cleaned=`$foamClean "$PATH"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
||||
#- Clean LD_LIBRARY_PATH
|
||||
set cleaned=`$foamClean "$LD_LIBRARY_PATH"`
|
||||
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
|
||||
|
||||
#- Clean MANPATH (trailing ':' to find system pages)
|
||||
set cleaned=`$foamClean "$MANPATH"`:
|
||||
if ( $status == 0 ) setenv MANPATH "$cleaned"
|
||||
|
||||
#- Clean LD_PRELOAD
|
||||
if ( $?LD_PRELOAD ) then
|
||||
set cleaned=`$foamClean "$LD_PRELOAD"`
|
||||
if ( $status == 0 ) setenv LD_PRELOAD $cleaned
|
||||
endif
|
||||
|
||||
# cleanup environment:
|
||||
# ~~~~~~~~~~~~~~~~~~~~
|
||||
unset cleaned foamClean foamInstall foamOldDirs
|
||||
unalias _foamSource
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
9435
etc/thermoData/therm.dat
Normal file
9435
etc/thermoData/therm.dat
Normal file
File diff suppressed because it is too large
Load Diff
37338
etc/thermoData/thermoData
Normal file
37338
etc/thermoData/thermoData
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user