Commit da76e142 authored by henry's avatar henry
Browse files
parents 7639571b 2e51c938
EXE_INC = \
-I$(LIB_SRC)/lagrangian/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
......@@ -8,4 +9,5 @@ EXE_LIBS = \
-lmeshTools \
-lfiniteVolume \
-llagrangian \
-lmolecule
-lmolecule \
-lpotential
File mode changed from 100755 to 100644
EXE_INC = \
-I$(LIB_SRC)/lagrangian/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
......@@ -8,4 +9,5 @@ EXE_LIBS = \
-lmeshTools \
-lfiniteVolume \
-llagrangian \
-lmolecule
-lmolecule \
-lpotential
......@@ -405,64 +405,71 @@ bool doCommand
backup(mesh, setName, currentSet, setName + "_old");
}
if (action == topoSetSource::CLEAR)
switch (action)
{
// Already handled above by not reading
}
else if (action == topoSetSource::INVERT)
{
currentSet.invert(currentSet.maxSize(mesh));
}
else if (action == topoSetSource::LIST)
{
currentSet.writeDebug(Pout, mesh, 100);
Pout<< endl;
}
else if (action == topoSetSource::SUBSET)
{
if (is >> sourceType)
case topoSetSource::CLEAR:
{
autoPtr<topoSetSource> setSource
(
topoSetSource::New
// Already handled above by not reading
break;
}
case topoSetSource::INVERT:
{
currentSet.invert(currentSet.maxSize(mesh));
break;
}
case topoSetSource::LIST:
{
currentSet.writeDebug(Pout, mesh, 100);
Pout<< endl;
break;
}
case topoSetSource::SUBSET:
{
if (is >> sourceType)
{
autoPtr<topoSetSource> setSource
(
topoSetSource::New
(
sourceType,
mesh,
is
)
);
// Backup current set.
topoSet oldSet
(
sourceType,
mesh,
is
)
);
currentSet.name() + "_old2",
currentSet
);
// Backup current set.
topoSet oldSet
(
mesh,
currentSet.name() + "_old2",
currentSet
);
currentSet.clear();
currentSet.resize(oldSet.size());
setSource().applyToSet(topoSetSource::NEW, currentSet);
currentSet.clear();
currentSet.resize(oldSet.size());
setSource().applyToSet(topoSetSource::NEW, currentSet);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
// Combine new value of currentSet with old one.
currentSet.subset(oldSet);
}
break;
}
}
else
{
if (is >> sourceType)
default:
{
autoPtr<topoSetSource> setSource
(
topoSetSource::New
if (is >> sourceType)
{
autoPtr<topoSetSource> setSource
(
sourceType,
mesh,
is
)
);
setSource().applyToSet(action, currentSet);
topoSetSource::New
(
sourceType,
mesh,
is
)
);
setSource().applyToSet(action, currentSet);
}
}
}
......@@ -532,7 +539,7 @@ bool doCommand
}
}
return error;
return !error;
}
......@@ -612,31 +619,36 @@ commandStatus parseType
switch(stat)
{
case polyMesh::UNCHANGED:
{
Pout<< " mesh not changed." << endl;
break;
break;
}
case polyMesh::POINTS_MOVED:
{
Pout<< " points moved; topology unchanged." << endl;
break;
break;
}
case polyMesh::TOPO_CHANGE:
{
Pout<< " topology changed; patches unchanged." << nl
<< " ";
printMesh(runTime, mesh);
break;
break;
}
case polyMesh::TOPO_PATCH_CHANGE:
{
Pout<< " topology changed and patches changed." << nl
<< " ";
printMesh(runTime, mesh);
break;
break;
}
default:
{
FatalErrorIn("parseType") << "Illegal mesh update state "
<< stat << abort(FatalError);
break;
break;
}
}
return INVALID;
......
patchSummary.C
EXE = $(FOAM_USER_APPBIN)/patchSummary
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
patchSummary
Description
Writes fields and boundary condition info for each patch at each requested
time instance.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "volFields.H"
#include "IOobjectList.H"
#include "patchSummaryTemplates.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
# include "createMesh.H"
for (label i=startTime; i<endTime; i++)
{
runTime.setTime(Times[i], i);
Info<< "Time = " << runTime.timeName() << nl << endl;
const IOobjectList fieldObjs(mesh, runTime.timeName());
const wordList objNames = fieldObjs.names();
PtrList<volScalarField> vsf(objNames.size());
PtrList<volVectorField> vvf(objNames.size());
PtrList<volSphericalTensorField> vsptf(objNames.size());
PtrList<volSymmTensorField> vsytf(objNames.size());
PtrList<volTensorField> vtf(objNames.size());
Info<< "Valid fields:" << endl;
forAll(objNames, objI)
{
IOobject obj
(
objNames[objI],
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
if (obj.headerOk())
{
addToFieldList<scalar>(vsf, obj, objI, mesh);
addToFieldList<vector>(vvf, obj, objI, mesh);
addToFieldList<sphericalTensor>(vsptf, obj, objI, mesh);
addToFieldList<symmTensor>(vsytf, obj, objI, mesh);
addToFieldList<tensor>(vtf, obj, objI, mesh);
}
}
Info<< endl;
const polyBoundaryMesh& bm = mesh.boundaryMesh();
forAll(bm, patchI)
{
Info<< "Patch: " << bm[patchI].name() << nl;
outputFieldList<scalar>(vsf, patchI);
outputFieldList<vector>(vvf, patchI);
outputFieldList<sphericalTensor>(vsptf, patchI);
outputFieldList<symmTensor>(vsytf, patchI);
outputFieldList<tensor>(vtf, patchI);
Info << endl;
}
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "patchSummaryTemplates.H"
#include "IOmanip.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
void Foam::addToFieldList
(
PtrList<GeometricField<Type, fvPatchField, volMesh> >& fieldList,
const IOobject& obj,
const label fieldI,
const fvMesh& mesh
)
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
if (obj.headerClassName() == fieldType::typeName)
{
fieldList.set
(
fieldI,
new fieldType(obj, mesh)
);
Info<< " " << fieldType::typeName << tab << obj.name() << endl;
}
}
template<class Type>
void Foam::outputFieldList
(
PtrList<GeometricField<Type, fvPatchField, volMesh> >& fieldList,
const label patchI
)
{
forAll(fieldList, fieldI)
{
if (fieldList.set(fieldI))
{
Info<< " " << pTraits<Type>::typeName << tab << tab
<< fieldList[fieldI].name() << tab << tab
<< fieldList[fieldI].boundaryField()[patchI].type() << nl;
}
}
}
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,33 +24,42 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
#ifndef patchSummaryTemplates_H
#define patchSummaryTemplates_H
inline const word& tetherPotential::tetherPotentialName() const
{
return tetherPotentialName_;
}
#include "fvCFD.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const word& tetherPotential::tetherPotentialType() const
namespace Foam
{
return tetherPotentialType_;
}
template<class Type>
void addToFieldList
(
PtrList<GeometricField<Type, fvPatchField, volMesh> >& fieldList,
const IOobject& obj,
const label fieldI,
const fvMesh& mesh
);
template<class Type>
void outputFieldList
(
PtrList<GeometricField<Type, fvPatchField, volMesh> >& fieldList,
const label patchI
);
} // End namespace Foam
inline scalar tetherPotential::springConstant() const
{
return springConstant_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "patchSummaryTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
#endif
// ************************************************************************* //
......@@ -3,7 +3,8 @@ EXE_INC = \
-I$(velocityDistributions) \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
......@@ -12,4 +13,5 @@ EXE_LIBS = \
-ldynamicMesh \
-lfiniteVolume \
-llagrangian \
-lmolecule
-lmolecule \
-lpotential
......@@ -47,7 +47,7 @@ printUsage() {
cat <<LABUSAGE
$PROGNAME - extracts xy files from Foam logs.
Usage: $PROGNAME [-n][-s] <root> <case> <log>
Usage: $PROGNAME [-n][-s] <log>
extracts xy files from log
$PROGNAME -l <log>
lists but does not extract
......@@ -82,11 +82,11 @@ files with the extracted data only.
The query database is a simple text format with three entries per line,
separated with '/'. Column 1 is the name of the variable (cannot contain
spaces), column 2 is the regular expression to select the line and
column 3 is the string to select the column inside the line. The value
taken will be the first (non-space)word after this column.
The database will either be \$HOME/.${PROGNAME}.db or if not found
$PROGDIR/${PROGNAME}.db.
spaces), column 2 is the extended regular expression (egrep) to select
the line and column 3 is the string (fgrep) to select the column inside the
line. The value taken will be the first (non-space)word after this
column. The database will either be \$HOME/.${PROGNAME}.db or if not
found $PROGDIR/${PROGNAME}.db.
Option -s suppresses the default information and only prints the extracted
variables.
......@@ -105,7 +105,7 @@ myEcho() {
# getSolvedVars logFile
# Prints names of all 'solved for' variables in the log file.
getSolvedVars() {
grep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u
fgrep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u
}
......@@ -163,7 +163,7 @@ getAllQueries() {
for var in $dbQueries
do
getQueries $1 "$var"
line=`grep "$LINEQ" $2`
line=`egrep "$LINEQ" $2`
if [ "$line" ]; then
column=`echo "$line" | fgrep "$NUMQ"`
if [ "$column" ]; then
......@@ -228,14 +228,13 @@ if [ "$LISTONLY" ]; then
exit 0
fi
if [ $# -ne 3 ]; then
if [ $# -ne 1 ]; then
printUsage
exit 1
fi
ROOT=$1
CASE=$2
LOG=$3
CASEDIR=.
LOG=$1
if [ ! -r $LOG ]; then
echo "$PROGNAME: Cannot read log $LOG"
exit 1
......@@ -244,13 +243,13 @@ fi
QUERYNAMES=`getAllQueries $DBFILE $LOG`
if [ ! "$ROOT" -o ! "$CASE" ]; then
if [ ! "$CASEDIR" ]; then
printUsage
exit 1
fi
if [ ! -d "$ROOT/$CASE" ]; then
echo "$PROGNAME: Cannot read $ROOT/$CASE"
if [ ! -d "$CASEDIR" ]; then
echo "$PROGNAME: Cannot read $CASEDIR"
exit 1
fi
......@@ -262,16 +261,14 @@ fi
#-- Make logs dir in case directory and put awk file there.
mkdir -p $ROOT/$CASE/logs
AWKFILE=$ROOT/$CASE/logs/$PROGNAME.awk
mkdir -p $CASEDIR/logs
AWKFILE=$CASEDIR/logs/$PROGNAME.awk
myEcho "Using:"
myEcho " root : $ROOT"
myEcho " case : $CASE"
myEcho " log : $LOG"
myEcho " database : $DBFILE"
myEcho " awk file : $AWKFILE"
myEcho " files to : $ROOT/$CASE/logs"
myEcho " files to : $CASEDIR/logs"
myEcho ""
......@@ -364,19 +361,19 @@ cat <<LABSOLVE >> $AWKFILE
varName=varNameVal[1]
file=varName "_" subIter[varName]++