mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
Conflicts: tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/rho tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/polyMesh/boundary tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/RASProperties tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/thermophysicalProperties tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/turbulenceProperties tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/cp tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/rho tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/boundary tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/fixedInlet tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/sideAndTopPatches tutorials/incompressible/simpleFoam/windTurbineTerrain/0/nut tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/RASProperties tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict
This commit is contained in:
@ -233,6 +233,44 @@ void storeCellInZone
|
||||
}
|
||||
|
||||
|
||||
// Reads mesh format
|
||||
scalar readMeshFormat(IFstream& inFile)
|
||||
{
|
||||
Info<< "Starting to read mesh format at line " << inFile.lineNumber() << endl;
|
||||
|
||||
string line;
|
||||
inFile.getLine(line);
|
||||
IStringStream lineStr(line);
|
||||
|
||||
scalar version;
|
||||
label asciiFlag, nBytes;
|
||||
lineStr >> version >> asciiFlag >> nBytes;
|
||||
|
||||
Info<< "Read format version " << version << " ascii " << asciiFlag << endl;
|
||||
|
||||
if (asciiFlag != 0)
|
||||
{
|
||||
FatalIOErrorIn("readMeshFormat(IFstream&)", inFile)
|
||||
<< "Can only read ascii msh files."
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
inFile.getLine(line);
|
||||
IStringStream tagStr(line);
|
||||
word tag(tagStr);
|
||||
|
||||
if (tag != "$EndMeshFormat")
|
||||
{
|
||||
FatalIOErrorIn("readMeshFormat(IFstream&)", inFile)
|
||||
<< "Did not find $ENDNOD tag on line "
|
||||
<< inFile.lineNumber() << exit(FatalIOError);
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
// Reads points and map
|
||||
void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam)
|
||||
{
|
||||
@ -278,9 +316,9 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam)
|
||||
|
||||
if (tag != "$ENDNOD" && tag != "$EndNodes")
|
||||
{
|
||||
FatalErrorIn("readPoints(..)")
|
||||
FatalIOErrorIn("readPoints(..)", inFile)
|
||||
<< "Did not find $ENDNOD tag on line "
|
||||
<< inFile.lineNumber() << exit(FatalError);
|
||||
<< inFile.lineNumber() << exit(FatalIOError);
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
@ -351,9 +389,9 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
||||
|
||||
if (tag != "$EndPhysicalNames")
|
||||
{
|
||||
FatalErrorIn("readPhysicalNames(..)")
|
||||
FatalIOErrorIn("readPhysicalNames(..)", inFile)
|
||||
<< "Did not find $EndPhysicalNames tag on line "
|
||||
<< inFile.lineNumber() << exit(FatalError);
|
||||
<< inFile.lineNumber() << exit(FatalIOError);
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
@ -362,7 +400,7 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
||||
// Reads cells and patch faces
|
||||
void readCells
|
||||
(
|
||||
const bool version2Format,
|
||||
const scalar versionFormat,
|
||||
const bool keepOrientation,
|
||||
const pointField& points,
|
||||
const Map<label>& mshToFoam,
|
||||
@ -426,23 +464,18 @@ void readCells
|
||||
|
||||
label elmNumber, elmType, regPhys;
|
||||
|
||||
if (version2Format)
|
||||
if (versionFormat >= 2)
|
||||
{
|
||||
lineStr >> elmNumber >> elmType;
|
||||
|
||||
label nTags;
|
||||
lineStr>> nTags;
|
||||
|
||||
label regElem, partition;
|
||||
|
||||
if (nTags == 3)
|
||||
if (nTags > 0)
|
||||
{
|
||||
lineStr >> regPhys >> regElem >> partition;
|
||||
}
|
||||
else
|
||||
{
|
||||
regPhys = 0;
|
||||
for (label i = 0; i < nTags; i++)
|
||||
// Assume the first tag is the physical surface
|
||||
lineStr >> regPhys;
|
||||
for (label i = 1; i < nTags; i++)
|
||||
{
|
||||
label dummy;
|
||||
lineStr>> dummy;
|
||||
@ -659,9 +692,9 @@ void readCells
|
||||
|
||||
if (tag != "$ENDELM" && tag != "$EndElements")
|
||||
{
|
||||
FatalErrorIn("readCells(..)")
|
||||
FatalIOErrorIn("readCells(..)", inFile)
|
||||
<< "Did not find $ENDELM tag on line "
|
||||
<< inFile.lineNumber() << exit(FatalError);
|
||||
<< inFile.lineNumber() << exit(FatalIOError);
|
||||
}
|
||||
|
||||
|
||||
@ -683,13 +716,13 @@ void readCells
|
||||
|
||||
if (cells.size() == 0)
|
||||
{
|
||||
FatalErrorIn("readCells(..)")
|
||||
FatalIOErrorIn("readCells(..)", inFile)
|
||||
<< "No cells read from file " << inFile.name() << nl
|
||||
<< "Does your file specify any 3D elements (hex=" << MSHHEX
|
||||
<< ", prism=" << MSHPRISM << ", pyramid=" << MSHPYR
|
||||
<< ", tet=" << MSHTET << ")?" << nl
|
||||
<< "Perhaps you have not exported the 3D elements?"
|
||||
<< exit(FatalError);
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
Info<< "CellZones:" << nl
|
||||
@ -749,7 +782,8 @@ int main(int argc, char *argv[])
|
||||
Map<word> physicalNames;
|
||||
|
||||
// Version 1 or 2 format
|
||||
bool version2Format = false;
|
||||
scalar versionFormat = 1;
|
||||
|
||||
|
||||
while (inFile.good())
|
||||
{
|
||||
@ -761,14 +795,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (tag == "$MeshFormat")
|
||||
{
|
||||
Info<< "Found $MeshFormat tag; assuming version 2 file format."
|
||||
<< endl;
|
||||
version2Format = true;
|
||||
|
||||
if (!skipSection(inFile))
|
||||
{
|
||||
break;
|
||||
}
|
||||
versionFormat = readMeshFormat(inFile);
|
||||
}
|
||||
else if (tag == "$PhysicalNames")
|
||||
{
|
||||
@ -782,7 +809,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
readCells
|
||||
(
|
||||
version2Format,
|
||||
versionFormat,
|
||||
keepOrientation,
|
||||
points,
|
||||
mshToFoam,
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ -f /usr/include/readline/readline.h ]
|
||||
unset COMP_FLAGS LINK_FLAGS
|
||||
|
||||
#
|
||||
# use readline if available
|
||||
# unless otherwise specified (with NO_READLINE)
|
||||
#
|
||||
# eg, ./Allwmake NO_READLINE
|
||||
#
|
||||
|
||||
if [ -f /usr/include/readline/readline.h -a "${1%NO_READLINE}" = "$1" ]
|
||||
then
|
||||
echo "Found readline/readline.h -- enabling readline support."
|
||||
export READLINE=1
|
||||
export READLINELINK="-lreadline -lncurses"
|
||||
else
|
||||
# no readline/readline.h -- disabling readline support
|
||||
export READLINE=0
|
||||
unset READLINELINK
|
||||
echo "Found <readline/readline.h> -- enabling readline support."
|
||||
export COMP_FLAGS="-DHAS_READLINE"
|
||||
export LINK_FLAGS="-lreadline -lncurses"
|
||||
fi
|
||||
|
||||
wmake
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
/* NB: trailing zero after define improves robustness */
|
||||
|
||||
EXE_INC = \
|
||||
-DREADLINE=$(READLINE)0 \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
$(COMP_FLAGS)
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
$(READLINELINK)
|
||||
$(LINK_FLAGS)
|
||||
|
||||
@ -49,7 +49,7 @@ Description
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#if READLINE != 0
|
||||
#ifdef HAS_READLINE
|
||||
# include <readline/readline.h>
|
||||
# include <readline/history.h>
|
||||
#endif
|
||||
@ -59,29 +59,10 @@ using namespace Foam;
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
#if READLINE != 0
|
||||
#ifdef HAS_READLINE
|
||||
static const char* historyFile = ".setSet";
|
||||
#endif
|
||||
|
||||
Istream& selectStream(Istream* is0Ptr, Istream* is1Ptr)
|
||||
{
|
||||
if (is0Ptr)
|
||||
{
|
||||
return *is0Ptr;
|
||||
}
|
||||
else if (is1Ptr)
|
||||
{
|
||||
return *is1Ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("selectStream(Istream*, Istream*)")
|
||||
<< "No valid stream opened" << abort(FatalError);
|
||||
|
||||
return *is0Ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Write set to VTK readable files
|
||||
void writeVTK
|
||||
@ -867,7 +848,7 @@ int main(int argc, char *argv[])
|
||||
printAllSets(mesh, Info);
|
||||
|
||||
// Read history if interactive
|
||||
# if READLINE != 0
|
||||
# ifdef HAS_READLINE
|
||||
if (!batch && !read_history(historyFile))
|
||||
{
|
||||
Info<< "Successfully read history from " << historyFile << endl;
|
||||
@ -949,7 +930,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
# if READLINE != 0
|
||||
# ifdef HAS_READLINE
|
||||
{
|
||||
char* linePtr = readline("readline>");
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
autoPtr<hCombustionThermo> thermo
|
||||
autoPtr<basicPsiThermo> thermo
|
||||
(
|
||||
hCombustionThermo::New(mesh)
|
||||
basicPsiThermo::New(mesh)
|
||||
);
|
||||
|
||||
const volScalarField& h = thermo->h();
|
||||
|
||||
Reference in New Issue
Block a user