Commit 407d047f authored by Andrew Heather's avatar Andrew Heather
Browse files
parents 75bb4275 c3d4f899
Info<< nl << "Reading field boundaryT" << endl;
volScalarField boundaryT
(
IOobject
(
"boundaryT",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field boundaryU" << endl;
volVectorField boundaryU
(
IOobject
(
"boundaryU",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field rhoN (number density)" << endl;
volScalarField rhoN
(
IOobject
(
"rhoN",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field rhoM (mass density)" << endl;
volScalarField rhoM
(
IOobject
(
"rhoM",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field rhoNdsmc (dsmc particle density)" << endl;
volScalarField dsmcRhoN
(
IOobject
(
"dsmcRhoN",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field momentum (momentum density)" << endl;
volVectorField momentum
(
IOobject
(
"momentum",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field linearKE (linear kinetic energy density)"
<< endl;
volScalarField linearKE
(
IOobject
(
"linearKE",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field internalE (internal energy density)" << endl;
volScalarField internalE
(
IOobject
(
"internalE",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field iDof (internal degree of freedom density)"
<< endl;
volScalarField iDof
(
IOobject
(
"iDof",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field q (surface heat transfer)" << endl;
volScalarField q
(
IOobject
(
"q",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Reading field fD (surface force density)" << endl;
volVectorField fD
(
IOobject
(
"fD",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< nl << "Constructing dsmcCloud " << endl;
dsmcCloud dsmc("dsmc", boundaryT, boundaryU);
......@@ -41,53 +41,21 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Constructing dsmcCloud " << endl;
dsmcCloud dsmc("dsmc", mesh);
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
while (runTime.loop())
{
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Carry out dsmcCloud timestep
dsmc.evolve();
// Retrieve flow field data from dsmcCloud
rhoN = dsmc.rhoN();
rhoN.correctBoundaryConditions();
rhoM = dsmc.rhoM();
rhoM.correctBoundaryConditions();
dsmcRhoN = dsmc.dsmcRhoN();
dsmcRhoN.correctBoundaryConditions();
momentum = dsmc.momentum();
momentum.correctBoundaryConditions();
linearKE = dsmc.linearKE();
linearKE.correctBoundaryConditions();
internalE = dsmc.internalE();
internalE.correctBoundaryConditions();
iDof = dsmc.iDof();
iDof.correctBoundaryConditions();
// Retrieve surface field data from dsmcCloud
q = dsmc.q();
fD = dsmc.fD();
// Print status of dsmcCloud
dsmc.info();
runTime.write();
......
DimensionedFieldTest.C
EXE = $(FOAM_USER_APPBIN)/DimensionedFieldTest
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
/* EXE_LIBS = -lfiniteVolume */
......@@ -33,7 +33,6 @@ Description
#include "HashPtrTable.H"
#include "Map.H"
#include "StaticHashTable.H"
#include "HashTbl.H"
#include "cpuTime.H"
using namespace Foam;
......@@ -53,7 +52,7 @@ int main(int argc, char *argv[])
// Map<label> map(2 * nSize);
// HashTable<label, label, Hash<label> > map(2 * nSize);
// StaticHashTable<label, label, Hash<label> > map(2 * nSize);
HashTbl<label, label, Hash<label> > map(2 * nSize);
HashTable<label, label, Hash<label> > map(2 * nSize);
Info<< "Constructed map of size: " << nSize
<< " (size " << map.size() << " capacity " << map.capacity() << ") "
......
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "Matrix.H"
#include "SquareMatrix.H"
#include "vector.H"
using namespace Foam;
......@@ -34,7 +34,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
Matrix<scalar> hmm(3, 3);
SquareMatrix<scalar> hmm(3);
hmm[0][0] = -3.0;
hmm[0][1] = 10.0;
......@@ -46,27 +46,27 @@ int main(int argc, char *argv[])
hmm[2][1] = 6.0;
hmm[2][2] = 1.0;
Info<< hmm << endl << hmm - 2.0*(-hmm) << endl;
//Info<< hmm << endl << hmm - 2.0*(-hmm) << endl;
Info<< max(hmm) << endl;
Info<< min(hmm) << endl;
Matrix<scalar> hmm2(3, 3, 1.0);
SquareMatrix<scalar> hmm2(3, 1.0);
hmm = hmm2;
Info<< hmm << endl;
Matrix<scalar> hmm3(Sin);
SquareMatrix<scalar> hmm3(Sin);
Info<< hmm3 << endl;
Matrix<scalar> hmm4;
SquareMatrix<scalar> hmm4;
hmm4 = hmm2;
Info<< hmm4 << endl;
Matrix<scalar> hmm5;
SquareMatrix<scalar> hmm5;
hmm4 = hmm5;
Info<< hmm5 << endl;
......
......@@ -69,7 +69,7 @@ public:
const scalar x,
const scalarField& y,
scalarField& dfdx,
Matrix<scalar>& dfdy
scalarSquareMatrix& dfdy
) const
{
dfdx[0] = 0.0;
......
......@@ -57,6 +57,8 @@ public:
Info <<"delete Scalar: " << data_ << endl;
}
autoPtr<Scalar> clone() const;
friend Ostream& operator<<(Ostream& os, const Scalar& val)
{
os << val.data_;
......
......@@ -84,11 +84,11 @@ int main(int argc, char *argv[])
// test List operations
List<double> flatList = UIndirectList<double>(completeList, addresses);
Info<< "List assigned from UIndirectList: " << flatList << endl;
List<double> flatList(UIndirectList<double>(completeList, addresses));
Info<< "List constructed from UIndirectList: " << flatList << endl;
List<double> flatList2(UIndirectList<double>(completeList, addresses));
Info<< "List constructed from UIndirectList: " << flatList2 << endl;
flatList = UIndirectList<double>(completeList, addresses);
Info<< "List assigned from UIndirectList: " << flatList << endl;
flatList.append(UIndirectList<double>(completeList, addresses));
Info<< "List::append(UIndirectList): " << flatList << endl;
......
......@@ -84,7 +84,7 @@ int main(int argc, char *argv[])
// Sync how many to send
labelListList allNTrans(Pstream::nProcs());
allNTrans[Pstream::myProcNo()] = nSend;
combineReduce(allNTrans, mapDistribute::listEq());
combineReduce(allNTrans, UPstream::listEq());
// Collect items to be sent
labelListList sendMap(Pstream::nProcs());
......@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
toMaster << data;
}
Perr<< "slave receiving from master "
Perr<< "slave receiving from master "
<< Pstream::masterNo() << endl;
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
fromMaster >> data;
......
......@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
volField
slicedFieldTest
Description
......@@ -32,16 +32,16 @@ Description
#include "fvCFD.H"
#include "SlicedGeometricField.H"
#include "slicedFvPatchFields.H"
#include "slicedSurfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
#include "createTime.H"
#include "createMesh.H"
Info<< "Reading field p\n" << endl;
volScalarField p
......@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
Info<< C << endl;
Info<< (C & U) << endl;
SlicedGeometricField<vector, fvPatchField, slicedFvPatchField, surfaceMesh>
SlicedGeometricField<vector, fvsPatchField, slicedFvsPatchField, surfaceMesh>
Sf
(
IOobject
......@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
mesh.faceAreas()
);
Info<< Sf << endl;
//Info<< Sf << endl;
return 0;
}
......
......@@ -48,8 +48,6 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createPolyMesh.H"
pointMesh pMesh(mesh);
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Get name of patch
......@@ -99,7 +97,7 @@ int main(int argc, char *argv[])
PointEdgeWave<pointEdgePoint> wallCalc
(
pMesh,
mesh,
wallPoints,
wallInfo,
......@@ -119,7 +117,7 @@ int main(int argc, char *argv[])
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
pMesh,
pointMesh::New(mesh),
dimensionedScalar("wallDist", dimLength, 0.0)
);
......
......@@ -34,11 +34,10 @@ Application
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
#include "createTime.H"
#include "createMesh.H"
Info<< "Reading field p\n" << endl;
volScalarField p
......@@ -70,12 +69,9 @@ int main(int argc, char *argv[])
mesh
);
# include "createPhi.H"
//Info<< transform(dimensionedTensor("I", dimless, 0.1*I), U) << endl;
#include "createPhi.H"
GeometricField<sphericalTensor, fvPatchField, volMesh> st
GeometricField<symmTensor, fvPatchField, volMesh> st
(
IOobject
(
......@@ -86,8 +82,8 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE
),
mesh,
dimensioned<sphericalTensor>("st", dimless, sphericalTensor::I),
zeroGradientFvPatchSphericalTensorField::typeName
dimensioned<symmTensor>("st", dimless, symmTensor::one),
zeroGradientFvPatchSymmTensorField::typeName
);
//Info<< fvc::div(st) << endl;
......
......@@ -45,7 +45,7 @@ Description
so cannot have any cells in any other zone.
- useCellZonesOnly does not do a walk and uses the cellZones only. Use
this if you don't mind having disconnected domains in a single region.
This option requires all cells to be in one (and one only) region.
This option requires all cells to be in one (and one only) cellZone.
\*---------------------------------------------------------------------------*/
......
......@@ -113,7 +113,16 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
return;
}
wordList extensiveVVFNames(IStringStream ("(momentumMean)")());
wordList extensiveVVFNames
(
IStringStream
(
"( \
momentumMean \
fDMean \
)"
)()
);
PtrList<volVectorField> extensiveVVFs(extensiveVVFNames.size());
......
......@@ -44,9 +44,21 @@ int main(int argc, char *argv[])
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
IOdictionary dsmcInitialiseDict
(
IOobject
(
"dsmcInitialiseDict",
mesh.time().system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
Info<< "Initialising dsmc for Time = " << runTime.timeName() << nl << endl;
dsmcCloud dsmc("dsmc", mesh);
dsmcCloud dsmc("dsmc", mesh, dsmcInitialiseDict);
label totalMolecules = dsmc.size();
......
......@@ -206,6 +206,21 @@ done
cmd=""
if [ .$WM_MPLIB = .OPENMPI ]; then
cmd="mpirun -app $PWD/mpirun.schema </dev/null"
elif [ .$WM_MPLIB = .MPICH ]; then
cmd="mpiexec"
for ((proc=0; proc<$nProcs; proc++))
do
read procCmd
procXtermCmdFile="$PWD/processor${proc}Xterm.sh"
echo "#!/bin/sh" > $procXtermCmdFile
echo "$procCmd" >> $procXtermCmdFile
chmod +x $procXtermCmdFile
if [ $proc -ne 0 ]; then
cmd="${cmd} :"
fi
cmd="${cmd} -n 1 ${procXtermCmdFile}"
done < $PWD/mpirun.schema
fi
echo "Constructed $PWD/mpirun.schema file."
......
......@@ -377,6 +377,7 @@ DebugSwitches
displacementLaplacian 0;
displacementSBRStress 0;
distanceSurface 0;
distribution 0;
downwind 0;
dragModel 0;
duplicatePoints 0;
......
......@@ -105,7 +105,7 @@ template<class Key, class Hash>
void Foam::HashSet<Key, Hash>::operator&=(const HashSet<Key, Hash>& rhs)
{
// Remove elements not also found in rhs
for (iterator iter = this->cbegin(); iter != this->cend(); ++iter)
for (iterator iter = this->begin(); iter != this->end(); ++iter)
{
if (!rhs.found(iter.key()))
{
......@@ -145,8 +145,6 @@ void Foam::HashSet<Key, Hash>::operator-=(const HashSet<Key, Hash>& rhs)
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
/* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
template<class Key, class Hash>
......
......@@ -184,6 +184,12 @@ public:
// an out-of-range element returns false without any ill-effects
inline const T& operator[](const label) const;
//- Return last element of UList.
inline T& last();
//- Return last element of UList.
inline const T& last() const;
//- Allow cast to a const List<T>&
inline operator const Foam::List<T>&() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment