Merge branch 'master' of ssh://hunt/home/hunt2/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2008-09-13 11:11:34 +01:00
5 changed files with 87 additions and 16 deletions

View File

@ -76,9 +76,9 @@ echo "run $args" > $HOME/gdbCommands
echo "where" >> $HOME/gdbCommands
echo "Constructed gdb initialization file $HOME/gdbCommands"
$ECHO "Choose running method: 1)gdb+xterm 2)gdb 3)log 4)xterm+valgrind: \c"
$ECHO "Choose running method: 1)gdb+xterm 2)gdb 3)log 4)log+xterm 5)xterm+valgrind: \c"
read method
if [ "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 ]; then
if [ "$method" -ne 1 -a "$method" -ne 2 -a "$method" -ne 3 -a "$method" -ne 4 -a "$method" -ne 5 ]; then
printUsage
exit 1
fi
@ -152,6 +152,9 @@ do
echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile
echo "${node}$procCmdFile" >> $HOME/mpirun.schema
elif [ "$method" -eq 4 ]; then
echo "$sourceFoam; cd $PWD; $exec $args 2>&1 | tee $procLog; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
elif [ "$method" -eq 5 ]; then
echo "$sourceFoam; cd $PWD; valgrind $exec $args; read dummy" >> $procCmdFile
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $HOME/mpirun.schema
fi

View File

@ -169,7 +169,7 @@ Foam::PackedList<1> Foam::syncTools::getMasterPoints(const polyMesh& mesh)
else
{
FatalErrorIn("syncTools::getMasterPoints(const polyMesh&)")
<< "Cannot handle patch " << patches[patchI].name()
<< "Cannot handle coupled patch " << patches[patchI].name()
<< " of type " << patches[patchI].type()
<< abort(FatalError);
}
@ -290,7 +290,7 @@ Foam::PackedList<1> Foam::syncTools::getMasterEdges(const polyMesh& mesh)
else
{
FatalErrorIn("syncTools::getMasterEdges(const polyMesh&)")
<< "Cannot handle patch " << patches[patchI].name()
<< "Cannot handle coupled patch " << patches[patchI].name()
<< " of type " << patches[patchI].type()
<< abort(FatalError);
}
@ -314,6 +314,54 @@ Foam::PackedList<1> Foam::syncTools::getMasterEdges(const polyMesh& mesh)
}
// Determines for every face whether it is coupled and if so sets only one.
Foam::PackedList<1> Foam::syncTools::getMasterFaces(const polyMesh& mesh)
{
PackedList<1> isMasterFace(mesh.nFaces(), 1);
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
{
if (patches[patchI].coupled())
{
if (Pstream::parRun() && isA<processorPolyPatch>(patches[patchI]))
{
const processorPolyPatch& pp =
refCast<const processorPolyPatch>(patches[patchI]);
if (!pp.owner())
{
forAll(pp, i)
{
isMasterFace.set(pp.start()+i, 0);
}
}
}
else if (isA<cyclicPolyPatch>(patches[patchI]))
{
const cyclicPolyPatch& pp =
refCast<const cyclicPolyPatch>(patches[patchI]);
for (label i = pp.size()/2; i < pp.size(); i++)
{
isMasterFace.set(pp.start()+i, 0);
}
}
else
{
FatalErrorIn("syncTools::getMasterFaces(const polyMesh&)")
<< "Cannot handle coupled patch " << patches[patchI].name()
<< " of type " << patches[patchI].type()
<< abort(FatalError);
}
}
}
return isMasterFace;
}
template <>
void Foam::syncTools::separateList
(

View File

@ -226,9 +226,12 @@ public:
//- Get per point whether is it master (of a coupled set of points)
static PackedList<1> getMasterPoints(const polyMesh&);
//- Get per edge whether is it master (of a coupled set of edge)
//- Get per edge whether is it master (of a coupled set of edges)
static PackedList<1> getMasterEdges(const polyMesh&);
//- Get per face whether is it master (of a coupled set of faces)
static PackedList<1> getMasterFaces(const polyMesh&);
};

View File

@ -58,15 +58,33 @@ inline bool contiguous<bool>() {return true;}
template<>
inline bool contiguous<char>() {return true;}
template<>
inline bool contiguous<unsigned char>() {return true;}
template<>
inline bool contiguous<short>() {return true;}
template<>
inline bool contiguous<unsigned short>() {return true;}
template<>
inline bool contiguous<int>() {return true;}
template<>
inline bool contiguous<unsigned int>() {return true;}
template<>
inline bool contiguous<long>() {return true;}
template<>
inline bool contiguous<unsigned long>() {return true;}
template<>
inline bool contiguous<long long>() {return true;}
template<>
inline bool contiguous<unsigned long long>() {return true;}
template<>
inline bool contiguous<float>() {return true;}

View File

@ -746,8 +746,7 @@ void Foam::polyDualMesh::calcDual
allBoundary.meshEdges
(
mesh.edges(),
mesh.cellEdges(),
SubList<label>(mesh.faceOwner(), allBoundary.size(), nIntFaces)
mesh.pointEdges()
)
);