Merge branch 'master' into cvm

This commit is contained in:
graham
2009-08-19 18:40:21 +01:00
267 changed files with 4610 additions and 2504 deletions

View File

@ -7,8 +7,7 @@
scalar epsilon = turbulence->epsilon()()[cellId];
// scalar omega = turbulence->omega()()[cellId];
scalar k = turbulence->k()()[cellId];
scalar Up =
flowDirection & (U[cellId] - U.boundaryField()[patchId][faceId]);
scalar magUp = mag(U[cellId] - U.boundaryField()[patchId][faceId]);
scalar tauw = flowDirection & R & wallNormal;
@ -16,7 +15,7 @@
scalar yPlus = uTau*y[cellId]/(nu + ROOTVSMALL);
scalar uPlus = Up/(uTau + ROOTVSMALL);
scalar uPlus = magUp/(uTau + ROOTVSMALL);
scalar nutPlus = nut/nu;
@ -26,7 +25,7 @@
// scalar omegaPlus = omega*nu/(sqr(uTau) + ROOTVSMALL);
scalar Rey = Up*y[cellId]/nu;
scalar Rey = magUp*y[cellId]/nu;
Info<< "Rey = " << Rey << ", uTau = " << uTau << ", nut+ = " << nutPlus
<< ", y+ = " << yPlus << ", u+ = " << uPlus

View File

@ -14,4 +14,3 @@
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);

View File

@ -56,20 +56,11 @@
);
dimensionedScalar rhoc
(
transportProperties.lookup("rhoc")
);
dimensionedScalar rhoc(transportProperties.lookup("rhoc"));
dimensionedScalar rhod
(
transportProperties.lookup("rhod")
);
dimensionedScalar rhod(transportProperties.lookup("rhod"));
dimensionedScalar muc
(
transportProperties.lookup("muc")
);
dimensionedScalar muc(transportProperties.lookup("muc"));
dimensionedScalar plasticViscosityCoeff
(
@ -96,10 +87,7 @@
transportProperties.lookup("yieldStressOffset")
);
Switch BinghamPlastic
(
transportProperties.lookup("BinghamPlastic")
);
Switch BinghamPlastic(transportProperties.lookup("BinghamPlastic"));
volScalarField rho
(
@ -147,8 +135,8 @@
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
muc +
plasticViscosity
muc
+ plasticViscosity
(
plasticViscosityCoeff,
plasticViscosityExponent,
@ -176,10 +164,7 @@
Info<< "Selecting Drift-Flux model " << endl;
word VdjModel
(
transportProperties.lookup("VdjModel")
);
word VdjModel(transportProperties.lookup("VdjModel"));
Info<< tab << VdjModel << " selected\n" << endl;
@ -188,26 +173,13 @@
transportProperties.subDict(VdjModel + "Coeffs")
);
dimensionedVector V0
(
VdjModelCoeffs.lookup("V0")
);
dimensionedVector V0(VdjModelCoeffs.lookup("V0"));
dimensionedScalar a
(
VdjModelCoeffs.lookup("a")
);
dimensionedScalar a(VdjModelCoeffs.lookup("a"));
dimensionedScalar a1
(
VdjModelCoeffs.lookup("a1")
);
dimensionedScalar alphaMin
(
VdjModelCoeffs.lookup("alphaMin")
);
dimensionedScalar a1(VdjModelCoeffs.lookup("a1"));
dimensionedScalar alphaMin(VdjModelCoeffs.lookup("alphaMin"));
IOdictionary RASProperties
@ -223,15 +195,9 @@
);
Switch turbulence
(
RASProperties.lookup("turbulence")
);
Switch turbulence(RASProperties.lookup("turbulence"));
dictionary kEpsilonDict
(
RASProperties.subDictPtr("kEpsilonCoeffs")
);
dictionary kEpsilonDict(RASProperties.subDictPtr("kEpsilonCoeffs"));
dimensionedScalar Cmu
(
@ -273,30 +239,27 @@
)
);
dimensionedScalar alphak
dimensionedScalar sigmak
(
dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
"sigmak",
kEpsilonDict,
1.0
)
);
dimensionedScalar alphaEps
dimensionedScalar sigmaEps
(
dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
"sigmaEps",
kEpsilonDict,
0.76923
1.3
)
);
dictionary wallFunctionDict
(
RASProperties.subDictPtr("wallFunctionCoeffs")
);
dictionary wallFunctionDict(RASProperties.subDictPtr("wallFunctionCoeffs"));
dimensionedScalar kappa
(

View File

@ -15,7 +15,7 @@ if(turbulence)
tgradU.clear();
volScalarField Gcoef =
alphak*Cmu*k*(g & fvc::grad(rho))/(epsilon + epsilon0);
Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilon0);
#include "wallFunctions.H"
@ -26,7 +26,7 @@ if(turbulence)
+ fvm::div(phi, epsilon)
- fvm::laplacian
(
alphaEps*mut + mul, epsilon,
mut/sigmaEps + mul, epsilon,
"laplacian(DepsilonEff,epsilon)"
)
==
@ -51,7 +51,7 @@ if(turbulence)
+ fvm::div(phi, k)
- fvm::laplacian
(
alphak*mut + mul, k,
mut/sigmak + mul, k,
"laplacian(DkEff,k)"
)
==

View File

@ -12,6 +12,7 @@
- fvm::laplacian(muEff, U)
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
//- fvc::div(rho*turbulence->nuEff()*dev(fvc::grad(U)().T()))
);
if (oCorr == nOuterCorr-1)

View File

@ -34,7 +34,7 @@ Description
#include "fvMesh.H"
#include "volFields.H"
#include "Time.H"
#include "mapDistribute.H"
//#include "mapDistribute.H"
#include "OFstream.H"
#include "meshTools.H"
//#include "FECCellToFaceStencil.H"

View File

@ -23,19 +23,23 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
icoFoam
parallelTest
Description
Incompressible laminar CFD code.
Test for various parallel routines.
\*---------------------------------------------------------------------------*/
#include "List.H"
#include "mapDistribute.H"
#include "argList.H"
#include "Time.H"
#include "IPstream.H"
#include "OPstream.H"
#include "vector.H"
#include "IOstreams.H"
#include "Random.H"
#include "Tuple2.H"
using namespace Foam;
@ -47,6 +51,99 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
// Test mapDistribute
// ~~~~~~~~~~~~~~~~~~
if (false)
{
Random rndGen(43544*Pstream::myProcNo());
// Generate random data.
List<Tuple2<label, List<scalar> > > complexData(100);
forAll(complexData, i)
{
complexData[i].first() = rndGen.integer(0, Pstream::nProcs()-1);
complexData[i].second().setSize(3);
complexData[i].second()[0] = 1;
complexData[i].second()[1] = 2;
complexData[i].second()[2] = 3;
}
// Send all ones to processor indicated by .first()
// Count how many to send
labelList nSend(Pstream::nProcs(), 0);
forAll(complexData, i)
{
label procI = complexData[i].first();
nSend[procI]++;
}
// Sync how many to send
labelListList allNTrans(Pstream::nProcs());
allNTrans[Pstream::myProcNo()] = nSend;
combineReduce(allNTrans, mapDistribute::listEq());
// Collect items to be sent
labelListList sendMap(Pstream::nProcs());
forAll(sendMap, procI)
{
sendMap[procI].setSize(nSend[procI]);
}
nSend = 0;
forAll(complexData, i)
{
label procI = complexData[i].first();
sendMap[procI][nSend[procI]++] = i;
}
// Collect items to be received
labelListList recvMap(Pstream::nProcs());
forAll(recvMap, procI)
{
recvMap[procI].setSize(allNTrans[procI][Pstream::myProcNo()]);
}
label constructSize = 0;
// Construct with my own elements first
forAll(recvMap[Pstream::myProcNo()], i)
{
recvMap[Pstream::myProcNo()][i] = constructSize++;
}
// Construct from other processors
forAll(recvMap, procI)
{
if (procI != Pstream::myProcNo())
{
forAll(recvMap[procI], i)
{
recvMap[procI][i] = constructSize++;
}
}
}
// Construct distribute map (destructively)
mapDistribute map(constructSize, sendMap.xfer(), recvMap.xfer());
// Distribute complexData
mapDistribute::distribute
(
Pstream::nonBlocking,
List<labelPair>(),
map.constructSize(),
map.subMap(),
map.constructMap(),
complexData
);
Pout<< "complexData:" << complexData << endl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Perr<< "\nStarting transfers\n" << endl;
@ -60,13 +157,13 @@ int main(int argc, char *argv[])
{
Perr<< "slave sending to master "
<< Pstream::masterNo() << endl;
OPstream toMaster(Pstream::masterNo());
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
toMaster << data;
}
Perr<< "slave receiving from master "
<< Pstream::masterNo() << endl;
IPstream fromMaster(Pstream::masterNo());
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
fromMaster >> data;
Perr<< data << endl;
@ -81,7 +178,7 @@ int main(int argc, char *argv[])
)
{
Perr << "master receiving from slave " << slave << endl;
IPstream fromSlave(slave);
IPstream fromSlave(Pstream::blocking, slave);
fromSlave >> data;
Perr<< data << endl;
@ -95,7 +192,7 @@ int main(int argc, char *argv[])
)
{
Perr << "master sending to slave " << slave << endl;
OPstream toSlave(slave);
OPstream toSlave(Pstream::blocking, slave);
toSlave << data;
}
}

View File

@ -105,6 +105,8 @@ int main(int argc, char *argv[])
Foam::argList::validOptions.insert("overwrite", "");
Foam::argList::validOptions.insert("toleranceDict", "file with tolerances");
# include "setRootCase.H"
# include "createTime.H"
runTime.functionObjects().off();
@ -168,6 +170,22 @@ int main(int argc, char *argv[])
<< "If this is not the case use the -partial option" << nl << endl;
}
// set up the tolerances for the sliding mesh
dictionary slidingTolerances;
if (args.options().found("toleranceDict"))
{
IOdictionary toleranceFile(
IOobject(
args.options()["toleranceDict"],
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
slidingTolerances += toleranceFile;
}
// Check for non-empty master and slave patches
checkPatch(mesh.boundaryMesh(), masterPatchName);
checkPatch(mesh.boundaryMesh(), slavePatchName);
@ -320,6 +338,11 @@ int main(int argc, char *argv[])
true // couple/decouple mode
)
);
static_cast<slidingInterface&>(stitcher[0]).setTolerances
(
slidingTolerances,
true
);
}

View File

@ -97,7 +97,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::XX)
sigma.component(symmTensor::XX)
);
sigmaxx.write();
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::YY)
sigma.component(symmTensor::YY)
);
sigmayy.write();
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::ZZ)
sigma.component(symmTensor::ZZ)
);
sigmazz.write();
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::XY)
sigma.component(symmTensor::XY)
);
sigmaxy.write();
@ -149,7 +149,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::XZ)
sigma.component(symmTensor::XZ)
);
sigmaxz.write();
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::YZ)
sigma.component(symmTensor::YZ)
);
sigmayz.write();
@ -190,7 +190,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
0.0*sigma.component(tensor::YZ)
0.0*sigma.component(symmTensor::YZ)
);
forAll(sigmaUn.boundaryField(), patchI)

View File

@ -72,7 +72,9 @@ namespace Foam
int main(int argc, char *argv[])
{
argList::validOptions.insert("instance", "instance");
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedMesh.H"
@ -83,6 +85,12 @@ int main(int argc, char *argv[])
regionPrefix = regionName;
}
word instance = runTime.timeName();
if (args.options().found("instance"))
{
instance = args.options()["instance"];
}
// Get the replacement rules from a dictionary
IOdictionary dict
(
@ -196,12 +204,13 @@ int main(int argc, char *argv[])
Info<< "Loading dictionary " << fieldName << endl;
const word oldTypeName = IOdictionary::typeName;
const_cast<word&>(IOdictionary::typeName) = word::null;
IOdictionary fieldDict
(
IOobject
(
fieldName,
runTime.timeName(),
instance,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,

View File

@ -158,45 +158,33 @@ int main(int argc, char *argv[])
label trianglei = 0;
label maxRegion1 = labelMin;
// Copy triangles1 into trianglesAll
// Determine max region.
forAll(surface1, faceI)
{
facesAll[trianglei] = surface1[faceI];
maxRegion1 = max(maxRegion1, facesAll[trianglei].region());
trianglei++;
facesAll[trianglei++] = surface1[faceI];
}
label nRegions1 = surface1.patches().size();
label nRegions1 = maxRegion1 + 1;
if (!mergeRegions)
{
Info<< "Surface " << inFileName1 << " has " << nRegions1 << " regions"
Info<< "Surface " << inFileName1 << " has " << nRegions1
<< " regions"
<< nl
<< "All region numbers in " << inFileName2 << " will be offset"
<< " by this amount" << nl << endl;
}
// Add (renumbered) surface2 triangles
label maxRegion2 = labelMin;
forAll(surface2, faceI)
{
const labelledTri& tri = surface2[faceI];
labelledTri& destTri = facesAll[trianglei++];
destTri[0] = tri[0] + points1.size();
destTri[1] = tri[1] + points1.size();
destTri[2] = tri[2] + points1.size();
maxRegion2 = max(maxRegion2, tri.region());
if (mergeRegions)
{
destTri.region() = tri.region();
@ -207,7 +195,7 @@ int main(int argc, char *argv[])
}
}
label nRegions2 = maxRegion2 + 1;
label nRegions2 = surface2.patches().size();
geometricSurfacePatchList newPatches;

View File

@ -16,7 +16,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Select triangles by label
faces ();
faces #include "badFaces";
// Select triangles using given points (local point numbering)
localPoints ( );

View File

@ -58,9 +58,9 @@ cat <<LABHELP
The default is to extract for all the 'Solved for' variables the initial
residual, the final residual and the number of iterations. Additionally, a
(user editable) database is used to extract data for standard non-solved for
variables like Courant number, execution time.
variables like Courant number, and execution time.
$PROGNAME -l lists all the possible variables without extract them.
$PROGNAME -l lists all the possible variables without extracting them.
The program will generate and run an awk script which writes a set of files,
logs/<var>_<subIter>, for every <var> specified, for every occurrence inside
@ -69,7 +69,7 @@ a time step.
For variables that are 'Solved for', the initial residual name will be
<var>, the final residual receive the name <var>FinalRes,
The files are a simple xy format with the first column Time (default)
The files are output in a simple xy format with the first column Time (default)
and the second the extracted values. Option -n creates single column
files with the extracted data only.
@ -82,6 +82,7 @@ separated with '/' :
The value taken will be the first (non-space)word after this column.
The database ($PROGNAME.db) will taken from these locations:
.
$HOME/.OpenFOAM/$WM_PROJECT_VERSION
$HOME/.OpenFOAM
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION
@ -98,6 +99,7 @@ LABHELP
# The various places to be searched:
for i in \
. \
$HOME/.OpenFOAM/$WM_PROJECT_VERSION \
$HOME/.OpenFOAM \
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION \
@ -114,7 +116,6 @@ do
done
myEcho() {
if [ "$VERBOSE" ]
then
@ -171,6 +172,7 @@ getSolveQueryList() {
done
}
# getAllQueries dbFile logFile
# Gets all queries from database and from logfile
getAllQueries() {
@ -202,6 +204,7 @@ getAllQueries() {
done | sort -u
}
#-----------------------------
# Main
#-----------------------------
@ -314,8 +317,6 @@ myEcho ""
# Generate Awk program
#-----------------------------
#-- header
rm -f $AWKFILE; touch $AWKFILE
@ -355,9 +356,6 @@ function extract(inLine,columnSel,outVar,
LABEL
#-- Generate code for iteration separator (increments 'Iteration')
getQueries $DBFILE 'Separator'
cat <<LABSEP >> $AWKFILE
@ -418,6 +416,7 @@ cat <<LABSOLVE >> $AWKFILE
LABSOLVE
#-- generate code to process queries
for queryName in $QUERYNAMES
do
@ -438,7 +437,6 @@ do
done
#-----------------------------
# Run awk program on log
#-----------------------------
@ -454,5 +452,6 @@ done
#-----------------------------
myEcho "Generated XY files for:"
getAllQueries $DBFILE $LOG
myEcho "End"
#------------------------------------------------------------------------------

View File

@ -345,6 +345,9 @@ $(globalMeshData)/globalIndex.C
$(polyMesh)/syncTools/syncTools.C
zone = $(polyMesh)/zones/zone
$(zone)/zone.C
cellZone = $(polyMesh)/zones/cellZone
$(cellZone)/cellZone.C
$(cellZone)/newCellZone.C

View File

@ -22,22 +22,10 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "MeshWave.H"
#include "polyMesh.H"
#include "processorPolyPatch.H"
#include "cyclicPolyPatch.H"
#include "OPstream.H"
#include "IPstream.H"
#include "PstreamReduceOps.H"
#include "debug.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -162,13 +162,14 @@ Foam::List<T>::List(const UList<T>& a, const unallocLabelList& map)
{
if (this->size_)
{
// Note:cannot use List_ELEM since third argument has to be index.
this->v_ = new T[this->size_];
List_ACCESS(T, (*this), vp);
List_CONST_ACCESS(T, a, ap);
List_FOR_ALL(map, i)
List_ELEM((*this), vp, i) = List_ELEM(a, ap, (map[i]));
List_END_FOR_ALL
forAll(*this, i)
{
this->v_[i] = a[map[i]];
}
}
}

View File

@ -45,40 +45,46 @@ char Foam::ISstream::nextValid()
// Return if stream is bad - ie, previous get() failed
if (bad() || isspace(c))
{
return 0;
break;
}
// Is this the start of a C/C++ comment?
if (c == '/')
{
// If cannot get another character, return this one
if (!get(c))
{
// cannot get another character - return this one
return '/';
}
if (c == '/')
{
// This is the start of a C++ style one-line comment
// C++ style single-line comment - skip through past end-of-line
while (get(c) && c != '\n')
{}
}
else if (c == '*')
{
// This is the start of a C style comment
// within a C-style comment
while (true)
{
// search for end of C-style comment - '*/'
if (get(c) && c == '*')
{
if (get(c) && c == '/')
if (get(c))
{
if (c == '/')
{
// matched '*/'
break;
}
else
else if (c == '*')
{
// check again
putback(c);
}
}
}
if (!good())
{
@ -86,17 +92,21 @@ char Foam::ISstream::nextValid()
}
}
}
else // A lone '/' so return it.
else
{
// The '/' did not start a C/C++ comment - return it
putback(c);
return '/';
}
}
else // c is a valid character so return it
else
{
// a valid character - return it
return c;
}
}
return 0;
}
@ -277,8 +287,8 @@ Foam::Istream& Foam::ISstream::read(token& t)
// }
}
// nothing converted (bad format), or trailing junk
if (endptr == buf || *endptr != '\0')
// not everything converted: bad format or trailing junk
if (*endptr)
{
t.setBad();
}
@ -289,7 +299,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
}
// Should be a word (which can be a single character)
// Should be a word (which can also be a single character)
default:
{
putback(c);

View File

@ -127,11 +127,10 @@ void Foam::Time::setControls()
}
else
{
WarningIn("Time::setControls()")
FatalIOErrorIn("Time::setControls()", controlDict_)
<< "expected startTime, firstTime or latestTime"
<< " found '" << startFrom
<< "' in dictionary " << controlDict_.name() << nl
<< " Setting time to " << startTime_ << endl;
<< " found '" << startFrom << "'"
<< exit(FatalIOError);
}
}
@ -151,10 +150,10 @@ void Foam::Time::setControls()
> Pstream::nProcs()*deltaT_/10.0
)
{
FatalErrorIn("Time::setControls()")
FatalIOErrorIn("Time::setControls()", controlDict_)
<< "Start time is not the same for all processors" << nl
<< "processor " << Pstream::myProcNo() << " has startTime "
<< startTime_ << exit(FatalError);
<< startTime_ << exit(FatalIOError);
}
}

View File

@ -117,6 +117,10 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv)
// get rootPath_ / globalCase_ from one of the following forms
// * [-case dir]
// * cwd
//
// Also export FOAM_CASE and FOAM_CASENAME environment variables
// so they can be used immediately (eg, in decomposeParDict)
//
void Foam::argList::getRootCase()
{
fileName casePath;
@ -151,6 +155,26 @@ void Foam::argList::getRootCase()
rootPath_ = casePath.path();
globalCase_ = casePath.name();
case_ = globalCase_;
// Set the case and case-name as an environment variable
if (rootPath_[0] == '/')
{
// absolute path - use as-is
setEnv("FOAM_CASE", rootPath_/globalCase_, true);
setEnv("FOAM_CASENAME", globalCase_, true);
}
else
{
// qualify relative path
fileName casePath = cwd()/rootPath_/globalCase_;
casePath.clean();
setEnv("FOAM_CASE", casePath, true);
setEnv("FOAM_CASENAME", casePath.name(), true);
}
}
@ -531,24 +555,6 @@ Foam::argList::argList
}
jobInfo.write();
// Set the case and case-name as an environment variable
if (rootPath_[0] == '/')
{
// absolute path - use as-is
setEnv("FOAM_CASE", rootPath_/globalCase_, true);
setEnv("FOAM_CASENAME", globalCase_, true);
}
else
{
// qualify relative path
fileName casePath = cwd()/rootPath_/globalCase_;
casePath.clean();
setEnv("FOAM_CASE", casePath, true);
setEnv("FOAM_CASENAME", casePath.name(), true);
}
// Switch on signal trapping. We have to wait until after Pstream::init
// since this sets up its own ones.
sigFpe_.set(bannerEnabled);

View File

@ -172,8 +172,8 @@ const Foam::List<Foam::labelPair>& Foam::mapDistribute::schedule() const
Foam::mapDistribute::mapDistribute
(
const label constructSize,
const labelListList& subMap,
const labelListList& constructMap
const Xfer<labelListList>& subMap,
const Xfer<labelListList>& constructMap
)
:
constructSize_(constructSize),
@ -183,22 +183,6 @@ Foam::mapDistribute::mapDistribute
{}
//- (optionally destructively) construct from components
Foam::mapDistribute::mapDistribute
(
const label constructSize,
labelListList& subMap,
labelListList& constructMap,
const bool reUse // clone or reuse
)
:
constructSize_(constructSize),
subMap_(subMap, reUse),
constructMap_(constructMap, reUse),
schedulePtr_()
{}
Foam::mapDistribute::mapDistribute
(
const labelList& sendProcs,
@ -286,7 +270,7 @@ Foam::mapDistribute::mapDistribute(const mapDistribute& map)
void Foam::mapDistribute::compact(const boolList& elemIsUsed)
{
// 1. send back to sender. Have him delete the corresponding element
// 1. send back to sender. Have sender delete the corresponding element
// from the submap and do the same to the constructMap locally
// (and in same order).

View File

@ -83,23 +83,36 @@ class mapDistribute
public:
// Public classes
//- combineReduce operator for lists. Used for counting.
class listEq
{
public:
template<class T>
void operator()(T& x, const T& y) const
{
forAll(y, i)
{
if (y[i].size())
{
x[i] = y[i];
}
}
}
};
// Constructors
//- Construct from components
mapDistribute
(
const label constructSize,
const labelListList& subMap,
const labelListList& constructMap
);
//- (optionally destructively) construct from components
mapDistribute
(
const label constructSize,
labelListList& subMap,
labelListList& constructMap,
const bool reUse // clone or reuse
const Xfer<labelListList>& subMap,
const Xfer<labelListList>& constructMap
);
//- Construct from reverse addressing: per data item the send
@ -205,11 +218,7 @@ public:
template<class T>
void distribute(List<T>& fld) const
{
if
(
Pstream::defaultCommsType == Pstream::nonBlocking
&& contiguous<T>()
)
if (Pstream::defaultCommsType == Pstream::nonBlocking)
{
distribute
(

View File

@ -68,35 +68,15 @@ public:
mapDistributeLagrangian
(
const label nNewParticles,
const labelListList& subParticleMap,
const labelListList& constructParticleMap,
const labelListList& constructCellLabels
const Xfer<labelListList>& subParticleMap,
const Xfer<labelListList>& constructParticleMap,
const Xfer<labelListList>& constructCellLabels
)
:
particleMap_(nNewParticles, subParticleMap, constructParticleMap),
constructCellLabels_(constructCellLabels)
{}
//- Construct from components and steal storage
mapDistributeLagrangian
(
const label nNewParticles,
labelListList& subParticleMap,
labelListList& constructParticleMap,
labelListList& constructCellLabels,
const bool reUse
)
:
particleMap_
(
nNewParticles,
subParticleMap,
constructParticleMap,
reUse
),
constructCellLabels_(constructCellLabels, reUse)
{}
// Member Functions

View File

@ -66,27 +66,27 @@ Foam::mapDistributePolyMesh::mapDistributePolyMesh
const label nOldPoints,
const label nOldFaces,
const label nOldCells,
const labelList& oldPatchStarts,
const labelList& oldPatchNMeshPoints,
const Xfer<labelList>& oldPatchStarts,
const Xfer<labelList>& oldPatchNMeshPoints,
// how to subset pieces of mesh to send across
const labelListList& subPointMap,
const labelListList& subFaceMap,
const labelListList& subCellMap,
const labelListList& subPatchMap,
const Xfer<labelListList>& subPointMap,
const Xfer<labelListList>& subFaceMap,
const Xfer<labelListList>& subCellMap,
const Xfer<labelListList>& subPatchMap,
// how to reconstruct received mesh
const labelListList& constructPointMap,
const labelListList& constructFaceMap,
const labelListList& constructCellMap,
const labelListList& constructPatchMap
const Xfer<labelListList>& constructPointMap,
const Xfer<labelListList>& constructFaceMap,
const Xfer<labelListList>& constructCellMap,
const Xfer<labelListList>& constructPatchMap
)
:
mesh_(mesh),
nOldPoints_(nOldPoints),
nOldFaces_(nOldFaces),
nOldCells_(nOldCells),
oldPatchSizes_(oldPatchStarts.size()),
oldPatchSizes_(oldPatchStarts().size()),
oldPatchStarts_(oldPatchStarts),
oldPatchNMeshPoints_(oldPatchNMeshPoints),
pointMap_(mesh.nPoints(), subPointMap, constructPointMap),
@ -98,44 +98,6 @@ Foam::mapDistributePolyMesh::mapDistributePolyMesh
}
//- (optionally destructively) construct from components
Foam::mapDistributePolyMesh::mapDistributePolyMesh
(
const polyMesh& mesh,
const label nOldPoints,
const label nOldFaces,
const label nOldCells,
labelList& oldPatchStarts,
labelList& oldPatchNMeshPoints,
labelListList& subPointMap,
labelListList& subFaceMap,
labelListList& subCellMap,
labelListList& subPatchMap,
labelListList& constructPointMap,
labelListList& constructFaceMap,
labelListList& constructCellMap,
labelListList& constructPatchMap,
const bool reUse // clone or reuse
)
:
mesh_(mesh),
nOldPoints_(nOldPoints),
nOldFaces_(nOldFaces),
nOldCells_(nOldCells),
oldPatchSizes_(oldPatchStarts.size()),
oldPatchStarts_(oldPatchStarts, reUse),
oldPatchNMeshPoints_(oldPatchNMeshPoints, reUse),
pointMap_(mesh.nPoints(), subPointMap, constructPointMap, reUse),
faceMap_(mesh.nFaces(), subFaceMap, constructFaceMap, reUse),
cellMap_(mesh.nCells(), subCellMap, constructCellMap, reUse),
patchMap_(mesh.boundaryMesh().size(), subPatchMap, constructPatchMap, reUse)
{
calcPatchSizes();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mapDistributePolyMesh::distributePointIndices(labelList& lst) const

View File

@ -120,42 +120,20 @@ public:
const label nOldPoints,
const label nOldFaces,
const label nOldCells,
const labelList& oldPatchStarts,
const labelList& oldPatchNMeshPoints,
const Xfer<labelList>& oldPatchStarts,
const Xfer<labelList>& oldPatchNMeshPoints,
// how to subset pieces of mesh to send across
const labelListList& subPointMap,
const labelListList& subFaceMap,
const labelListList& subCellMap,
const labelListList& subPatchMap,
const Xfer<labelListList>& subPointMap,
const Xfer<labelListList>& subFaceMap,
const Xfer<labelListList>& subCellMap,
const Xfer<labelListList>& subPatchMap,
// how to reconstruct received mesh
const labelListList& constructPointMap,
const labelListList& constructFaceMap,
const labelListList& constructCellMap,
const labelListList& constructPatchMap
);
//- (optionally destructively) construct from components
// Note that mesh has to be changed already!
mapDistributePolyMesh
(
const polyMesh& mesh,
const label nOldPoints,
const label nOldFaces,
const label nOldCells,
labelList& oldPatchStarts,
labelList& oldPatchNMeshPoints,
labelListList& subPointMap,
labelListList& subFaceMap,
labelListList& subCellMap,
labelListList& subPatchMap,
labelListList& constructPointMap,
labelListList& constructFaceMap,
labelListList& constructCellMap,
labelListList& constructPatchMap,
const bool reUse // clone or reuse
const Xfer<labelListList>& constructPointMap,
const Xfer<labelListList>& constructFaceMap,
const Xfer<labelListList>& constructCellMap,
const Xfer<labelListList>& constructPatchMap
);

View File

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "Pstream.H"
#include "PstreamCombineReduceOps.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -183,6 +184,122 @@ void Foam::mapDistribute::distribute
else if (commsType == Pstream::nonBlocking)
{
if (!contiguous<T>())
{
// 1. convert to contiguous buffer
// 2. send buffer
// 3. receive buffer
// 4. read from buffer into List<T>
List<List<char> > sendFields(Pstream::nProcs());
labelListList allNTrans(Pstream::nProcs());
labelList& nsTransPs = allNTrans[Pstream::myProcNo()];
nsTransPs.setSize(Pstream::nProcs(), 0);
// Stream data into sendField buffers
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = subMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
// Put data into send buffer
OPstream toDomain(Pstream::nonBlocking, domain);
toDomain << UIndirectList<T>(field, map);
// Store the size
nsTransPs[domain] = toDomain.bufPosition();
// Transfer buffer out
sendFields[domain].transfer(toDomain.buf());
toDomain.bufPosition() = 0;
}
}
// Send sizes across
combineReduce(allNTrans, listEq());
// Start sending buffers
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = subMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
OPstream::write
(
Pstream::nonBlocking,
domain,
reinterpret_cast<const char*>
(
sendFields[domain].begin()
),
nsTransPs[domain]
);
}
}
// Set up receives from neighbours
PtrList<IPstream> fromSlave(Pstream::nProcs());
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = constructMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
// Start receiving
fromSlave.set
(
domain,
new IPstream
(
Pstream::nonBlocking,
domain,
allNTrans[domain][Pstream::myProcNo()]
)
);
}
}
{
// Set up 'send' to myself
const labelList& mySubMap = subMap[Pstream::myProcNo()];
List<T> mySubField(mySubMap.size());
forAll(mySubMap, i)
{
mySubField[i] = field[mySubMap[i]];
}
// Combine bits. Note that can reuse field storage
field.setSize(constructSize);
// Receive sub field from myself
{
const labelList& map = constructMap[Pstream::myProcNo()];
forAll(map, i)
{
field[map[i]] = mySubField[i];
}
}
}
// Wait till all finished
IPstream::waitRequests();
OPstream::waitRequests();
// Consume
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = constructMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
List<T> recvField(fromSlave[domain]);
if (recvField.size() != map.size())
{
FatalErrorIn
(
@ -196,10 +313,24 @@ void Foam::mapDistribute::distribute
" const labelListList& constructMap,\n"
" List<T>& field\n"
")\n"
) << "Non-blocking only supported for contiguous data."
<< exit(FatalError);
) << "Expected from processor " << domain
<< " " << map.size() << " but received "
<< recvField.size() << " elements."
<< abort(FatalError);
}
forAll(map, i)
{
field[map[i]] = recvField[i];
}
// Delete receive buffer
fromSlave.set(domain, NULL);
}
}
}
else
{
// Set up sends to neighbours
List<List<T > > sendFields(Pstream::nProcs());
@ -222,7 +353,7 @@ void Foam::mapDistribute::distribute
Pstream::nonBlocking,
domain,
reinterpret_cast<const char*>(subField.begin()),
subField.size()*sizeof(T)
subField.byteSize()
);
}
}
@ -243,7 +374,7 @@ void Foam::mapDistribute::distribute
Pstream::nonBlocking,
domain,
reinterpret_cast<char*>(recvFields[domain].begin()),
recvFields[domain].size()*sizeof(T)
recvFields[domain].byteSize()
);
}
}
@ -320,6 +451,7 @@ void Foam::mapDistribute::distribute
}
}
}
}
else
{
FatalErrorIn("mapDistribute::distribute(..)")
@ -487,6 +619,117 @@ void Foam::mapDistribute::distribute
else if (commsType == Pstream::nonBlocking)
{
if (!contiguous<T>())
{
// 1. convert to contiguous buffer
// 2. send buffer
// 3. receive buffer
// 4. read from buffer into List<T>
List<List<char> > sendFields(Pstream::nProcs());
labelListList allNTrans(Pstream::nProcs());
labelList& nsTransPs = allNTrans[Pstream::myProcNo()];
nsTransPs.setSize(Pstream::nProcs());
// Stream data into sendField buffers
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = subMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
// Put data into send buffer
OPstream toDomain(Pstream::nonBlocking, domain);
toDomain << UIndirectList<T>(field, map);
// Store the size
nsTransPs[domain] = toDomain.bufPosition();
// Transfer buffer out
sendFields[domain].transfer(toDomain.buf());
toDomain.bufPosition() = 0;
}
}
// Send sizes across
combineReduce(allNTrans, listEq());
// Start sending buffers
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = subMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
OPstream::write
(
Pstream::nonBlocking,
domain,
reinterpret_cast<const char*>
(
sendFields[domain].begin()
),
nsTransPs[domain]
);
}
}
// Set up receives from neighbours
PtrList<IPstream> fromSlave(Pstream::nProcs());
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = constructMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
// Start receiving
fromSlave.set
(
domain,
new IPstream
(
Pstream::nonBlocking,
domain,
allNTrans[domain][Pstream::myProcNo()]
)
);
}
}
{
// Set up 'send' to myself
List<T> mySubField(field, subMap[Pstream::myProcNo()]);
// Combine bits. Note that can reuse field storage
field.setSize(constructSize);
field = nullValue;
// Receive sub field from myself
{
const labelList& map = constructMap[Pstream::myProcNo()];
forAll(map, i)
{
cop(field[map[i]], mySubField[i]);
}
}
}
// Wait till all finished
IPstream::waitRequests();
OPstream::waitRequests();
// Consume
for (label domain = 0; domain < Pstream::nProcs(); domain++)
{
const labelList& map = constructMap[domain];
if (domain != Pstream::myProcNo() && map.size())
{
List<T> recvField(fromSlave[domain]);
if (recvField.size() != map.size())
{
FatalErrorIn
(
@ -500,10 +743,24 @@ void Foam::mapDistribute::distribute
" const labelListList& constructMap,\n"
" List<T>& field\n"
")\n"
) << "Non-blocking only supported for contiguous data."
<< exit(FatalError);
) << "Expected from processor " << domain
<< " " << map.size() << " but received "
<< recvField.size() << " elements."
<< abort(FatalError);
}
forAll(map, i)
{
cop(field[map[i]], recvField[i]);
}
// Delete receive buffer
fromSlave.set(domain, NULL);
}
}
}
else
{
// Set up sends to neighbours
List<List<T > > sendFields(Pstream::nProcs());
@ -623,6 +880,7 @@ void Foam::mapDistribute::distribute
}
}
}
}
else
{
FatalErrorIn("mapDistribute::distribute(..)")

View File

@ -1305,7 +1305,7 @@ bool Foam::cyclicPolyPatch::order
{
label baffleI = 0;
forAll(*this, faceI)
forAll(pp, faceI)
{
const face& f = pp.localFaces()[faceI];
const labelList& pFaces = pp.pointFaces()[f[0]];

View File

@ -114,6 +114,7 @@ public:
return index_ > -1;
}
// Edit
//- Update

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
A subset of mesh cells.
\*---------------------------------------------------------------------------*/
#include "cellZone.H"
@ -45,59 +42,9 @@ namespace Foam
addToRunTimeSelectionTable(cellZone, cellZone, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::Map<Foam::label>& Foam::cellZone::cellLookupMap() const
{
if (!cellLookupMapPtr_)
{
calcCellLookupMap();
}
return *cellLookupMapPtr_;
}
void Foam::cellZone::calcCellLookupMap() const
{
if (debug)
{
Info<< "void cellZone::calcCellLookupMap() const : "
<< "Calculating cell lookup map"
<< endl;
}
if (cellLookupMapPtr_)
{
FatalErrorIn
(
"void cellZone::calcCellLookupMap() const"
) << "cell lookup map already calculated"
<< abort(FatalError);
}
const labelList& addr = *this;
cellLookupMapPtr_ = new Map<label>(2*addr.size());
Map<label>& clm = *cellLookupMapPtr_;
forAll (addr, cellI)
{
clm.insert(addr[cellI], cellI);
}
if (debug)
{
Info<< "void cellZone::calcCellLookupMap() const : "
<< "Finished calculating cell lookup map"
<< endl;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::cellZone::cellZone
(
const word& name,
@ -106,11 +53,8 @@ Foam::cellZone::cellZone
const cellZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
zone(name, addr, index),
zoneMesh_(zm)
{}
@ -122,15 +66,11 @@ Foam::cellZone::cellZone
const cellZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
zone(name, addr, index),
zoneMesh_(zm)
{}
// Construct from dictionary
Foam::cellZone::cellZone
(
const word& name,
@ -139,16 +79,11 @@ Foam::cellZone::cellZone
const cellZoneMesh& zm
)
:
labelList(dict.lookup("cellLabels")),
name_(name),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
zone("cell", name, dict, index),
zoneMesh_(zm)
{}
// Construct given the original zone and resetting the
// cell list and zone mesh information
Foam::cellZone::cellZone
(
const cellZone& cz,
@ -157,11 +92,8 @@ Foam::cellZone::cellZone
const cellZoneMesh& zm
)
:
labelList(addr),
name_(cz.name()),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
zone(cz, addr, index),
zoneMesh_(zm)
{}
Foam::cellZone::cellZone
@ -172,38 +104,22 @@ Foam::cellZone::cellZone
const cellZoneMesh& zm
)
:
labelList(addr),
name_(cz.name()),
index_(index),
zoneMesh_(zm),
cellLookupMapPtr_(NULL)
zone(cz, addr, index),
zoneMesh_(zm)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellZone::~cellZone()
{
clearAddressing();
}
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::cellZone::whichCell(const label globalCellID) const
{
const Map<label>& clm = cellLookupMap();
Map<label>::const_iterator clmIter = clm.find(globalCellID);
if (clmIter == clm.end())
{
return -1;
}
else
{
return clmIter();
}
return zone::localID(globalCellID);
}
@ -213,45 +129,9 @@ const Foam::cellZoneMesh& Foam::cellZone::zoneMesh() const
}
void Foam::cellZone::clearAddressing()
{
deleteDemandDrivenData(cellLookupMapPtr_);
}
bool Foam::cellZone::checkDefinition(const bool report) const
{
const labelList& addr = *this;
bool boundaryError = false;
forAll(addr, i)
{
if (addr[i] < 0 || addr[i] >= zoneMesh_.mesh().nCells())
{
boundaryError = true;
if (report)
{
SeriousErrorIn
(
"bool cellZone::checkDefinition("
"const bool report) const"
) << "Zone " << name()
<< " contains invalid cell label " << addr[i] << nl
<< "Valid cell labels are 0.."
<< zoneMesh_.mesh().nCells()-1 << endl;
}
}
}
return boundaryError;
}
void Foam::cellZone::write(Ostream& os) const
{
os << nl << name()
<< nl << static_cast<const labelList&>(*this);
return zone::checkDefinition(zoneMesh_.mesh().nCells(), report);
}
@ -284,10 +164,10 @@ void Foam::cellZone::operator=(const labelList& addr)
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const cellZone& p)
Foam::Ostream& Foam::operator<<(Ostream& os, const cellZone& cz)
{
p.write(os);
os.check("Ostream& operator<<(Ostream& f, const cellZone& p");
cz.write(os);
os.check("Ostream& operator<<(Ostream& os, const cellZone& cz");
return os;
}

View File

@ -42,12 +42,8 @@ SourceFiles
#ifndef cellZone_H
#define cellZone_H
#include "labelList.H"
#include "typeInfo.H"
#include "dictionary.H"
#include "zone.H"
#include "cellZoneMeshFwd.H"
#include "pointFieldFwd.H"
#include "Map.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,36 +62,22 @@ Ostream& operator<<(Ostream&, const cellZone&);
class cellZone
:
public labelList
public zone
{
// Private data
//- Name of zone
word name_;
protected:
//- Index of zone
label index_;
// Protected data
//- Reference to zone list
const cellZoneMesh& zoneMesh_;
// Demand-driven private data
//- Map of cell labels in zone for fast location lookup
mutable Map<label>* cellLookupMapPtr_;
// Private Member Functions
//- Disallow default bitwise copy construct
cellZone(const cellZone&);
//- Return map of local cell indices
const Map<label>& cellLookupMap() const;
//- Build map of local cell indices
void calcCellLookupMap() const;
public:
@ -208,45 +190,19 @@ public:
//- Destructor
virtual ~cellZone();
// Member Functions
//- Return name
const word& name() const
{
return name_;
}
//- Map storing the local cell index for every global cell
// index. Used to find out the index of cell in the zone from
// the known global cell index. If the cell is not in the
// zone, returns -1
//- Helper function to re-direct to zone::localID(...)
label whichCell(const label globalCellID) const;
//- Return the index of this zone in zone list
label index() const
{
return index_;
}
//- Return zoneMesh reference
const cellZoneMesh& zoneMesh() const;
//- Clear addressing
void clearAddressing();
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;
//- Correct patch after moving points
virtual void movePoints(const pointField&)
{}
//- Write
virtual void write(Ostream&) const;
virtual bool checkDefinition(const bool report = false) const;
//- Write dictionary
virtual void writeDict(Ostream&) const;
@ -261,8 +217,9 @@ public:
void operator=(const labelList&);
// Ostream Operator
// I-O
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const cellZone&);
};

View File

@ -22,15 +22,11 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellZone.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
@ -61,7 +57,7 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
"const label, const cellZoneMesh&)",
dict
) << "Unknown cellZone type " << zoneType << endl << endl
<< "Valid cellZone types are :" << endl
<< "Valid cellZone types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
@ -70,6 +66,4 @@ Foam::autoPtr<Foam::cellZone> Foam::cellZone::New
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
A subset of mesh faces.
\*---------------------------------------------------------------------------*/
#include "faceZone.H"
@ -100,54 +97,6 @@ void Foam::faceZone::calcFaceZonePatch() const
}
const Foam::Map<Foam::label>& Foam::faceZone::faceLookupMap() const
{
if (!faceLookupMapPtr_)
{
calcFaceLookupMap();
}
return *faceLookupMapPtr_;
}
void Foam::faceZone::calcFaceLookupMap() const
{
if (debug)
{
Info<< "void faceZone::calcFaceLookupMap() const : "
<< "Calculating face lookup map"
<< endl;
}
if (faceLookupMapPtr_)
{
FatalErrorIn
(
"void faceZone::calcFaceLookupMap() const"
) << "face lookup map already calculated"
<< abort(FatalError);
}
const labelList& addr = *this;
faceLookupMapPtr_ = new Map<label>(2*addr.size());
Map<label>& flm = *faceLookupMapPtr_;
forAll (addr, faceI)
{
flm.insert(addr[faceI], faceI);
}
if (debug)
{
Info<< "void faceZone::calcFaceLookupMap() const : "
<< "Finished calculating face lookup map"
<< endl;
}
}
void Foam::faceZone::calcCellLayers() const
{
if (debug)
@ -228,16 +177,13 @@ Foam::faceZone::faceZone
const faceZoneMesh& zm
)
:
labelList(addr),
name_(name),
zone(name, addr, index),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
mePtr_(NULL)
{
checkAddressing();
}
@ -252,22 +198,18 @@ Foam::faceZone::faceZone
const faceZoneMesh& zm
)
:
labelList(addr),
name_(name),
zone(name, addr, index),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
mePtr_(NULL)
{
checkAddressing();
}
// Construct from dictionary
Foam::faceZone::faceZone
(
const word& name,
@ -276,23 +218,18 @@ Foam::faceZone::faceZone
const faceZoneMesh& zm
)
:
labelList(dict.lookup("faceLabels")),
name_(name),
zone("face", name, dict, index),
flipMap_(dict.lookup("flipMap")),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
mePtr_(NULL)
{
checkAddressing();
}
// Construct given the original zone and resetting the
// face list and zone mesh information
Foam::faceZone::faceZone
(
const faceZone& fz,
@ -302,16 +239,13 @@ Foam::faceZone::faceZone
const faceZoneMesh& zm
)
:
labelList(addr),
name_(fz.name()),
zone(fz, addr, index),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
mePtr_(NULL)
{
checkAddressing();
}
@ -326,16 +260,13 @@ Foam::faceZone::faceZone
const faceZoneMesh& zm
)
:
labelList(addr),
name_(fz.name()),
zone(fz, addr, index),
flipMap_(fm),
index_(index),
zoneMesh_(zm),
patchPtr_(NULL),
masterCellsPtr_(NULL),
slaveCellsPtr_(NULL),
mePtr_(NULL),
faceLookupMapPtr_(NULL)
mePtr_(NULL)
{
checkAddressing();
}
@ -351,29 +282,18 @@ Foam::faceZone::~faceZone()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::faceZone::whichFace(const label globalFaceID) const
{
const Map<label>& flm = faceLookupMap();
Map<label>::const_iterator flmIter = flm.find(globalFaceID);
if (flmIter == flm.end())
{
return -1;
}
else
{
return flmIter();
}
}
const Foam::faceZoneMesh& Foam::faceZone::zoneMesh() const
{
return zoneMesh_;
}
Foam::label Foam::faceZone::whichFace(const label globalFaceID) const
{
return zone::localID(globalFaceID);
}
const Foam::primitiveFacePatch& Foam::faceZone::operator()() const
{
if (!patchPtr_)
@ -450,13 +370,14 @@ const Foam::labelList& Foam::faceZone::meshEdges() const
void Foam::faceZone::clearAddressing()
{
zone::clearAddressing();
deleteDemandDrivenData(patchPtr_);
deleteDemandDrivenData(masterCellsPtr_);
deleteDemandDrivenData(slaveCellsPtr_);
deleteDemandDrivenData(mePtr_);
deleteDemandDrivenData(faceLookupMapPtr_);
}
@ -504,30 +425,7 @@ void Foam::faceZone::updateMesh(const mapPolyMesh& mpm)
bool Foam::faceZone::checkDefinition(const bool report) const
{
const labelList& addr = *this;
bool boundaryError = false;
forAll(addr, i)
{
if (addr[i] < 0 || addr[i] >= zoneMesh().mesh().faces().size())
{
boundaryError = true;
if (report)
{
SeriousErrorIn
(
"bool faceZone::checkDefinition("
"const bool report) const"
) << "Zone " << name()
<< " contains invalid face label " << addr[i] << nl
<< "Valid face labels are 0.."
<< zoneMesh().mesh().faces().size()-1 << endl;
}
}
}
return boundaryError;
return zone::checkDefinition(zoneMesh().mesh().faces().size(), report);
}
@ -642,10 +540,10 @@ void Foam::faceZone::writeDict(Ostream& os) const
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const faceZone& p)
Foam::Ostream& Foam::operator<<(Ostream& os, const faceZone& fz)
{
p.write(os);
os.check("Ostream& operator<<(Ostream& f, const faceZone& p");
fz.write(os);
os.check("Ostream& operator<<(Ostream& os, const faceZone& fz");
return os;
}

View File

@ -41,13 +41,10 @@ SourceFiles
#ifndef faceZone_H
#define faceZone_H
#include "typeInfo.H"
#include "dictionary.H"
#include "labelList.H"
#include "zone.H"
#include "faceZoneMeshFwd.H"
#include "boolList.H"
#include "primitiveFacePatch.H"
#include "Map.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -68,20 +65,17 @@ Ostream& operator<<(Ostream&, const faceZone&);
class faceZone
:
public labelList
public zone
{
// Private data
//- Name of zone
word name_;
protected:
// Protected data
//- Flip map for all faces in the zone. Set to true if the
// face needs to be flipped to achieve the correct orientation.
boolList flipMap_;
//- Index of zone
label index_;
//- Reference to zone list
const faceZoneMesh& zoneMesh_;
@ -100,9 +94,6 @@ class faceZone
//- Global edge addressing
mutable labelList* mePtr_;
//- Map of face labels in zone for fast location lookup
mutable Map<label>* faceLookupMapPtr_;
// Private Member Functions
@ -118,9 +109,6 @@ class faceZone
//- Return map of local face indices
const Map<label>& faceLookupMap() const;
//- Build map of local face indices
void calcFaceLookupMap() const;
//- Calculate master and slave face layer
void calcCellLayers() const;
@ -244,38 +232,23 @@ public:
//- Destructor
virtual ~faceZone();
// Member Functions
//- Return name
const word& name() const
{
return name_;
}
//- Return face flip map
const boolList& flipMap() const
{
return flipMap_;
}
//- Map storing the local face index for every global face index.
// Used to find out the index of face in the zone from the known global
// face index. If the face is not in the zone, returns -1
label whichFace(const label globalFaceID) const;
//- Helper function to re-direct to zone::localID(...)
label whichFace(const label globalCellID) const;
//- Return reference to primitive patch
const primitiveFacePatch& operator()() const;
//- Return the index of this zone in zone list
label index() const
{
return index_;
}
//- Return zoneMesh reference
const faceZoneMesh& zoneMesh() const;
@ -294,23 +267,23 @@ public:
//- Clear addressing
void clearAddressing();
virtual void clearAddressing();
//- Reset addressing and flip map (clearing demand-driven data)
void resetAddressing(const labelList&, const boolList&);
virtual void resetAddressing(const labelList&, const boolList&);
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;
virtual bool checkDefinition(const bool report = false) const;
//- Check whether all procs have faces synchronised. Return
// true if in error.
bool checkParallelSync(const bool report = false) const;
virtual bool checkParallelSync(const bool report = false) const;
//- Correct patch after moving points
virtual void movePoints(const pointField&);
//- Update for changes in topology
void updateMesh(const mapPolyMesh& mpm);
virtual void updateMesh(const mapPolyMesh& mpm);
//- Write
virtual void write(Ostream&) const;
@ -319,8 +292,9 @@ public:
virtual void writeDict(Ostream&) const;
// Ostream Operator
// I-O
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const faceZone&);
};

View File

@ -22,15 +22,11 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "faceZone.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
@ -61,7 +57,7 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
"const label, const faceZoneMesh&)",
dict
) << "Unknown faceZone type " << zoneType << endl << endl
<< "Valid faceZone types are :" << endl
<< "Valid faceZone types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
@ -70,6 +66,4 @@ Foam::autoPtr<Foam::faceZone> Foam::faceZone::New
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -22,15 +22,11 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "pointZone.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
@ -61,7 +57,7 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
"const label, const pointZoneMesh&)",
dict
) << "Unknown pointZone type " << zoneType << endl << endl
<< "Valid pointZone types are :" << endl
<< "Valid pointZone types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
@ -69,6 +65,5 @@ Foam::autoPtr<Foam::pointZone> Foam::pointZone::New
return autoPtr<pointZone>(cstrIter()(name, dict, index, zm));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
A subset of mesh points.
\*---------------------------------------------------------------------------*/
#include "pointZone.H"
@ -43,59 +40,9 @@ namespace Foam
addToRunTimeSelectionTable(pointZone, pointZone, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::Map<Foam::label>& Foam::pointZone::pointLookupMap() const
{
if (!pointLookupMapPtr_)
{
calcPointLookupMap();
}
return *pointLookupMapPtr_;
}
void Foam::pointZone::calcPointLookupMap() const
{
if (debug)
{
Info<< "void pointZone::calcPointLookupMap() const : "
<< "Calculating point lookup map"
<< endl;
}
if (pointLookupMapPtr_)
{
FatalErrorIn
(
"void pointZone::calcPointLookupMap() const"
) << "point lookup map already calculated"
<< abort(FatalError);
}
const labelList& addr = *this;
pointLookupMapPtr_ = new Map<label>(2*addr.size());
Map<label>& plm = *pointLookupMapPtr_;
forAll (addr, pointI)
{
plm.insert(addr[pointI], pointI);
}
if (debug)
{
Info<< "void pointZone::calcPointLookupMap() const : "
<< "Finished calculating point lookup map"
<< endl;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::pointZone::pointZone
(
const word& name,
@ -104,11 +51,8 @@ Foam::pointZone::pointZone
const pointZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
zone(name, addr, index),
zoneMesh_(zm)
{}
@ -120,15 +64,11 @@ Foam::pointZone::pointZone
const pointZoneMesh& zm
)
:
labelList(addr),
name_(name),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
zone(name, addr, index),
zoneMesh_(zm)
{}
// Construct from dictionary
Foam::pointZone::pointZone
(
const word& name,
@ -137,16 +77,11 @@ Foam::pointZone::pointZone
const pointZoneMesh& zm
)
:
labelList(dict.lookup("pointLabels")),
name_(name),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
zone("point", name, dict, index),
zoneMesh_(zm)
{}
// Construct given the original zone and resetting the
// point list and zone mesh information
Foam::pointZone::pointZone
(
const pointZone& pz,
@ -155,11 +90,8 @@ Foam::pointZone::pointZone
const pointZoneMesh& zm
)
:
labelList(addr),
name_(pz.name()),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
zone(pz, addr, index),
zoneMesh_(zm)
{}
@ -171,92 +103,40 @@ Foam::pointZone::pointZone
const pointZoneMesh& zm
)
:
labelList(addr),
name_(pz.name()),
index_(index),
zoneMesh_(zm),
pointLookupMapPtr_(NULL)
zone(pz, addr, index),
zoneMesh_(zm)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pointZone::~pointZone()
{
clearAddressing();
}
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::pointZone::whichPoint(const label globalPointID) const
{
const Map<label>& plm = pointLookupMap();
Map<label>::const_iterator plmIter = plm.find(globalPointID);
if (plmIter == plm.end())
{
return -1;
}
else
{
return plmIter();
}
}
const Foam::pointZoneMesh& Foam::pointZone::zoneMesh() const
{
return zoneMesh_;
}
void Foam::pointZone::clearAddressing()
Foam::label Foam::pointZone::whichPoint(const label globalPointID) const
{
deleteDemandDrivenData(pointLookupMapPtr_);
return zone::localID(globalPointID);
}
bool Foam::pointZone::checkDefinition(const bool report) const
{
const labelList& addr = *this;
bool boundaryError = false;
forAll(addr, i)
{
if (addr[i] < 0 || addr[i] >= zoneMesh_.mesh().points().size())
{
boundaryError = true;
if (report)
{
SeriousErrorIn
(
"bool pointZone::checkDefinition("
"const bool report) const"
) << "Zone " << name()
<< " contains invalid point label " << addr[i] << nl
<< "Valid point labels are 0.."
<< zoneMesh_.mesh().points().size()-1 << endl;
}
}
}
return boundaryError;
}
void Foam::pointZone::write(Ostream& os) const
{
os << nl << name()
<< nl << static_cast<const labelList&>(*this);
return zone::checkDefinition(zoneMesh_.mesh().points().size(), report);
}
void Foam::pointZone::writeDict(Ostream& os) const
{
os << nl << name() << nl << token::BEGIN_BLOCK << nl
os << nl << name_ << nl << token::BEGIN_BLOCK << nl
<< " type " << type() << token::END_STATEMENT << nl;
writeEntry("pointLabels", os);
@ -267,10 +147,10 @@ void Foam::pointZone::writeDict(Ostream& os) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::pointZone::operator=(const pointZone& cz)
void Foam::pointZone::operator=(const pointZone& pz)
{
clearAddressing();
labelList::operator=(cz);
labelList::operator=(pz);
}
@ -283,10 +163,10 @@ void Foam::pointZone::operator=(const labelList& addr)
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const pointZone& p)
Foam::Ostream& Foam::operator<<(Ostream& os, const pointZone& pz)
{
p.write(os);
os.check("Ostream& operator<<(Ostream& f, const pointZone& p");
pz.write(os);
os.check("Ostream& operator<<(Ostream& os, const pointZone& pz");
return os;
}

View File

@ -43,12 +43,8 @@ SourceFiles
#ifndef pointZone_H
#define pointZone_H
#include "labelList.H"
#include "typeInfo.H"
#include "dictionary.H"
#include "zone.H"
#include "pointZoneMeshFwd.H"
#include "Map.H"
#include "pointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,37 +63,22 @@ Ostream& operator<<(Ostream&, const pointZone&);
class pointZone
:
public labelList
public zone
{
protected:
// Private data
//- Name of zone
word name_;
//- Index of zone
label index_;
//- Reference to zone list
const pointZoneMesh& zoneMesh_;
// Demand-driven private data
//- Map of point labels in zone for fast location lookup
mutable Map<label>* pointLookupMapPtr_;
// Private Member Functions
//- Disallow default bitwise copy construct
pointZone(const pointZone&);
//- Return map of local point indices
const Map<label>& pointLookupMap() const;
//- Build map of local point indices
void calcPointLookupMap() const;
public:
@ -210,46 +191,24 @@ public:
//- Destructor
virtual ~pointZone();
// Member Functions
//- Return name
const word& name() const
{
return name_;
}
//- Map storing the local point index for every global point
// index. Used to find out the index of point in the zone from
// the known global point index. If the point is not in the
// zone, returns -1
label whichPoint(const label globalPointID) const;
//- Return the index of this zone in zone list
label index() const
{
return index_;
}
//- Return zoneMesh reference
const pointZoneMesh& zoneMesh() const;
//- Clear addressing
void clearAddressing();
//- Helper function to re-direct to zone::localID(...)
label whichPoint(const label globalPointID) const;
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;
virtual bool checkDefinition(const bool report = false) const;
//- Correct patch after moving points
virtual void movePoints(const pointField&)
{}
//- Write
virtual void write(Ostream&) const;
//- Write dictionary
virtual void writeDict(Ostream&) const;
@ -263,8 +222,9 @@ public:
void operator=(const labelList&);
// Ostream Operator
// I-O
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const pointZone&);
};

View File

@ -0,0 +1,239 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 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 "zone.H"
#include "IOstream.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(zone, 0);
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
const Foam::Map<Foam::label>& Foam::zone::lookupMap() const
{
if (!lookupMapPtr_)
{
calcLookupMap();
}
return *lookupMapPtr_;
}
void Foam::zone::calcLookupMap() const
{
if (debug)
{
Info<< "void zone::calcLookupMap() const: "
<< "Calculating lookup map"
<< endl;
}
if (lookupMapPtr_)
{
FatalErrorIn("void zone::calcLookupMap() const")
<< "Lookup map already calculated" << nl
<< abort(FatalError);
}
const labelList& addr = *this;
lookupMapPtr_ = new Map<label>(2*addr.size());
Map<label>& lm = *lookupMapPtr_;
forAll(addr, i)
{
lm.insert(addr[i], i);
}
if (debug)
{
Info<< "void zone::calcLookupMap() const: "
<< "Finished calculating lookup map"
<< endl;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::zone::zone
(
const word& name,
const labelList& addr,
const label index
)
:
labelList(addr),
name_(name),
index_(index),
lookupMapPtr_(NULL)
{}
Foam::zone::zone
(
const word& name,
const Xfer<labelList>& addr,
const label index
)
:
labelList(addr),
name_(name),
index_(index),
lookupMapPtr_(NULL)
{}
Foam::zone::zone
(
const word& zoneType,
const word& name,
const dictionary& dict,
const label index
)
:
labelList(dict.lookup(zoneType + "Labels")),
name_(name),
index_(index),
lookupMapPtr_(NULL)
{}
Foam::zone::zone
(
const zone& z,
const labelList& addr,
const label index
)
:
labelList(addr),
name_(z.name()),
index_(index),
lookupMapPtr_(NULL)
{}
Foam::zone::zone
(
const zone& z,
const Xfer<labelList>& addr,
const label index
)
:
labelList(addr),
name_(z.name()),
index_(index),
lookupMapPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::zone::~zone()
{
clearAddressing();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::zone::localID(const label globalCellID) const
{
const Map<label>& lm = lookupMap();
Map<label>::const_iterator lmIter = lm.find(globalCellID);
if (lmIter == lm.end())
{
return -1;
}
else
{
return lmIter();
}
}
void Foam::zone::clearAddressing()
{
deleteDemandDrivenData(lookupMapPtr_);
}
bool Foam::zone::checkDefinition(const label maxSize, const bool report) const
{
const labelList& addr = *this;
bool boundaryError = false;
forAll(addr, i)
{
if (addr[i] < 0 || addr[i] >= maxSize)
{
boundaryError = true;
if (report)
{
SeriousErrorIn
(
"bool zone::checkDefinition("
"const label maxSize, const bool report) const"
) << "Zone " << name_
<< " contains invalid index label " << addr[i] << nl
<< "Valid index labels are 0.."
<< maxSize-1 << endl;
}
}
}
return boundaryError;
}
void Foam::zone::write(Ostream& os) const
{
os << nl << name_
<< nl << static_cast<const labelList&>(*this);
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const zone& z)
{
z.write(os);
os.check("Ostream& operator<<(Ostream& f, const zone& z");
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,207 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 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
Class
Foam::cellZone
Description
Base class for zones
SourceFiles
zone.C
\*---------------------------------------------------------------------------*/
#ifndef zone_H
#define zone_H
#include "labelList.H"
#include "typeInfo.H"
#include "dictionary.H"
#include "Map.H"
#include "pointFieldFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
class zone;
Ostream& operator<<(Ostream&, const zone&);
/*---------------------------------------------------------------------------*\
Class zone Declaration
\*---------------------------------------------------------------------------*/
class zone
:
public labelList
{
protected:
// Protected data
//- Name of zone
word name_;
//- Index of zone
label index_;
// Demand-driven private data
//- Map of labels in zone for fast location lookup
mutable Map<label>* lookupMapPtr_;
// Protected Member Functions
//- Return a reference to the look-up map
const Map<label>& lookupMap() const;
//- Construct the look-up map
void calcLookupMap() const;
//- Disallow default bitwise copy construct
zone(const zone&);
public:
//- Runtime type information
TypeName("zone");
// Constructors
//- Construct from components
zone
(
const word& name,
const labelList& addr,
const label index
);
//- Construct from components, transferring contents
zone
(
const word& name,
const Xfer<labelList>& addr,
const label index
);
//- Construct from dictionary
zone
(
const word& zoneType,
const word& name,
const dictionary&,
const label index
);
//- Construct given the original zone and resetting the
// cell list and zone mesh information
zone
(
const zone&,
const labelList& addr,
const label index
);
//- Construct given the original zone, resetting the
// cell list and zone mesh information
zone
(
const zone&,
const Xfer<labelList>& addr,
const label index
);
//- Destructor
virtual ~zone();
// Member Functions
//- Return name
const word& name() const
{
return name_;
}
//- Map storing the local index for every global index. Used to find
// the index of the item in the zone from the known global index. If
// the item is not in the zone, returns -1
label localID(const label globalID) const;
//- Return the index of this zone in zone list
label index() const
{
return index_;
}
//- Clear addressing
virtual void clearAddressing();
//- Check zone definition. Return true if in error.
virtual bool checkDefinition(const bool report = false) const = 0;
//- Check zone definition with max size given. Return true if in error.
virtual bool checkDefinition
(
const label maxSize,
const bool report = false
) const;
//- Correct patch after moving points
virtual void movePoints(const pointField&)
{}
//- Write
virtual void write(Ostream&) const;
//- Write dictionary
virtual void writeDict(Ostream&) const = 0;
// I-O
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const zone&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -376,16 +376,29 @@ inline pointHit triangle<Point, PointRef>::ray
return ray(p, q1 - n, alg, intersection::VECTOR);
}
// Intersection point with triangle plane
point pInter;
// Is intersection point inside triangle
bool hit;
{
// Reuse the fast ray intersection routine below in FULL_RAY
// mode since the original intersection routine has rounding problems.
pointHit fastInter = intersection(p, q1, intersection::FULL_RAY);
pInter = fastInter.rawPoint();
hit = fastInter.hit();
if (hit)
{
pInter = fastInter.rawPoint();
}
else
{
// Calculate intersection of ray with triangle plane
vector v = a_ - p;
pInter = p + (q1&v)*q1;
}
}
// Distance to intersection point
scalar dist = q1 & (pInter - p);
const scalar planarPointTol =

View File

@ -41,6 +41,20 @@ Foam::DynamicList<MPI_Request> OPstream_outstandingRequests_;
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::OPstream::~OPstream()
{
if (commsType_ == nonBlocking)
{
// alloc nonBlocking only if empty buffer. This denotes the buffer
// having been transfered out.
if (bufPosition_ > 0)
{
FatalErrorIn("OPstream::~OPstream()")
<< "OPstream contains buffer so cannot be used with nonBlocking"
<< " since destructor would destroy buffer whilst possibly"
<< " still sending." << Foam::abort(FatalError);
}
}
else
{
if
(
@ -54,10 +68,11 @@ Foam::OPstream::~OPstream()
)
{
FatalErrorIn("OPstream::~OPstream()")
<< "MPI_Bsend cannot send outgoing message"
<< "MPI cannot send outgoing message"
<< Foam::abort(FatalError);
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -28,12 +28,9 @@ License
#include "fvMesh.H"
#include "Time.H"
#include "boundBox.H"
#include "globalIndex.H"
#include "wallPolyPatch.H"
#include "mapDistributePolyMesh.H"
#include "cellSet.H"
#include "syncTools.H"
#include "motionSmoother.H"
#include "refinementParameters.H"
#include "snapParameters.H"
#include "layerParameters.H"

View File

@ -28,14 +28,13 @@ License
#include "meshRefinement.H"
#include "fvMesh.H"
#include "Time.H"
#include "boundBox.H"
#include "mapDistributePolyMesh.H"
#include "cellSet.H"
#include "syncTools.H"
#include "refinementParameters.H"
#include "featureEdgeMesh.H"
#include "refinementSurfaces.H"
#include "shellSurfaces.H"
#include "mapDistributePolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -1418,18 +1418,18 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
nOldPoints,
nOldFaces,
nOldCells,
oldPatchStarts,
oldPatchNMeshPoints,
oldPatchStarts.xfer(),
oldPatchNMeshPoints.xfer(),
labelListList(1, identity(mesh_.nPoints())),//subPointMap
labelListList(1, identity(mesh_.nFaces())), //subFaceMap
labelListList(1, identity(mesh_.nCells())), //subCellMap
labelListList(1, identity(patches.size())), //subPatchMap
labelListList(1, identity(mesh_.nPoints())).xfer(),//subPointMap
labelListList(1, identity(mesh_.nFaces())).xfer(), //subFaceMap
labelListList(1, identity(mesh_.nCells())).xfer(), //subCellMap
labelListList(1, identity(patches.size())).xfer(), //subPatchMap
labelListList(1, identity(mesh_.nPoints())),//constructPointMap
labelListList(1, identity(mesh_.nFaces())), //constructFaceMap
labelListList(1, identity(mesh_.nCells())), //constructCellMap
labelListList(1, identity(patches.size())) //constructPatchMap
labelListList(1, identity(mesh_.nPoints())).xfer(),//pointMap
labelListList(1, identity(mesh_.nFaces())).xfer(), //faceMap
labelListList(1, identity(mesh_.nCells())).xfer(), //cellMap
labelListList(1, identity(patches.size())).xfer() //patchMap
)
);
}
@ -2207,19 +2207,18 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
nOldPoints,
nOldFaces,
nOldCells,
oldPatchStarts,
oldPatchNMeshPoints,
oldPatchStarts.xfer(),
oldPatchNMeshPoints.xfer(),
subPointMap,
subFaceMap,
subCellMap,
subPatchMap,
subPointMap.xfer(),
subFaceMap.xfer(),
subCellMap.xfer(),
subPatchMap.xfer(),
constructPointMap,
constructFaceMap,
constructCellMap,
constructPatchMap,
true // reuse storage
constructPointMap.xfer(),
constructFaceMap.xfer(),
constructCellMap.xfer(),
constructPatchMap.xfer()
)
);
}

View File

@ -43,7 +43,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar Foam::slidingInterface::edgeCoPlanarTol_ = 0.8;
const Foam::scalar Foam::slidingInterface::edgeCoPlanarTolDefault_ = 0.8;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -27,10 +27,8 @@ License
#include "slidingInterface.H"
#include "polyTopoChanger.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "polyTopoChange.H"
#include "addToRunTimeSelectionTable.H"
#include "triPointRef.H"
#include "plane.H"
// Index of debug signs:
@ -173,6 +171,14 @@ Foam::slidingInterface::slidingInterface
attached_(false),
projectionAlgo_(algo),
trigger_(false),
pointMergeTol_(pointMergeTolDefault_),
edgeMergeTol_(edgeMergeTolDefault_),
nFacesPerSlaveEdge_(nFacesPerSlaveEdgeDefault_),
edgeFaceEscapeLimit_(edgeFaceEscapeLimitDefault_),
integralAdjTol_(integralAdjTolDefault_),
edgeMasterCatchFraction_(edgeMasterCatchFractionDefault_),
edgeCoPlanarTol_(edgeCoPlanarTolDefault_),
edgeEndCutoffTol_(edgeEndCutoffTolDefault_),
cutFaceMasterPtr_(NULL),
cutFaceSlavePtr_(NULL),
masterFaceCellsPtr_(NULL),
@ -280,6 +286,9 @@ Foam::slidingInterface::slidingInterface
masterPointEdgeHitsPtr_(NULL),
projectedSlavePointsPtr_(NULL)
{
// Optionally default tolerances from dictionary
setTolerances(dict);
checkDefinition();
// If the interface is attached, the master and slave face zone addressing
@ -686,6 +695,63 @@ const Foam::pointField& Foam::slidingInterface::pointProjection() const
return *projectedSlavePointsPtr_;
}
void Foam::slidingInterface::setTolerances(const dictionary&dict, bool report)
{
pointMergeTol_ = dict.lookupOrDefault<scalar>
(
"pointMergeTol",
pointMergeTol_
);
edgeMergeTol_ = dict.lookupOrDefault<scalar>
(
"edgeMergeTol",
edgeMergeTol_
);
nFacesPerSlaveEdge_ = dict.lookupOrDefault<scalar>
(
"nFacesPerSlaveEdge",
nFacesPerSlaveEdge_
);
edgeFaceEscapeLimit_ = dict.lookupOrDefault<scalar>
(
"edgeFaceEscapeLimit",
edgeFaceEscapeLimit_
);
integralAdjTol_ = dict.lookupOrDefault<scalar>
(
"integralAdjTol",
integralAdjTol_
);
edgeMasterCatchFraction_ = dict.lookupOrDefault<scalar>
(
"edgeMasterCatchFraction",
edgeMasterCatchFraction_
);
edgeCoPlanarTol_ = dict.lookupOrDefault<scalar>
(
"edgeCoPlanarTol",
edgeCoPlanarTol_
);
edgeEndCutoffTol_ = dict.lookupOrDefault<scalar>
(
"edgeEndCutoffTol",
edgeEndCutoffTol_
);
if (report)
{
Info<< "Sliding interface parameters:" << nl
<< "pointMergeTol : " << pointMergeTol_ << nl
<< "edgeMergeTol : " << edgeMergeTol_ << nl
<< "nFacesPerSlaveEdge : " << nFacesPerSlaveEdge_ << nl
<< "edgeFaceEscapeLimit : " << edgeFaceEscapeLimit_ << nl
<< "integralAdjTol : " << integralAdjTol_ << nl
<< "edgeMasterCatchFraction : " << edgeMasterCatchFraction_ << nl
<< "edgeCoPlanarTol : " << edgeCoPlanarTol_ << nl
<< "edgeEndCutoffTol : " << edgeEndCutoffTol_ << endl;
}
}
void Foam::slidingInterface::write(Ostream& os) const
{
@ -703,6 +769,14 @@ void Foam::slidingInterface::write(Ostream& os) const
}
// To write out all those tolerances
#define WRITE_NON_DEFAULT(name) \
if( name ## _ != name ## Default_ )\
{ \
os << " " #name " " << name ## _ << token::END_STATEMENT << nl; \
}
void Foam::slidingInterface::writeDict(Ostream& os) const
{
os << nl << name() << nl << token::BEGIN_BLOCK << nl
@ -743,6 +817,15 @@ void Foam::slidingInterface::writeDict(Ostream& os) const
<< token::END_STATEMENT << nl;
}
WRITE_NON_DEFAULT(pointMergeTol)
WRITE_NON_DEFAULT(edgeMergeTol)
WRITE_NON_DEFAULT(nFacesPerSlaveEdge)
WRITE_NON_DEFAULT(edgeFaceEscapeLimit)
WRITE_NON_DEFAULT(integralAdjTol)
WRITE_NON_DEFAULT(edgeMasterCatchFraction)
WRITE_NON_DEFAULT(edgeCoPlanarTol)
WRITE_NON_DEFAULT(edgeEndCutoffTol)
os << token::END_BLOCK << endl;
}

View File

@ -129,6 +129,32 @@ private:
//- Trigger topological change
mutable bool trigger_;
// Tolerances. Initialised to static ones below.
//- Point merge tolerance
scalar pointMergeTol_;
//- Edge merge tolerance
scalar edgeMergeTol_;
//- Estimated number of faces an edge goes through
label nFacesPerSlaveEdge_;
//- Edge-face interaction escape limit
label edgeFaceEscapeLimit_;
//- Integral match point adjustment tolerance
scalar integralAdjTol_;
//- Edge intersection master catch fraction
scalar edgeMasterCatchFraction_;
//- Edge intersection co-planar tolerance
scalar edgeCoPlanarTol_;
//- Edge end cut-off tolerance
scalar edgeEndCutoffTol_;
// Private addressing data.
@ -256,28 +282,28 @@ private:
// Static data members
//- Point merge tolerance
static const scalar pointMergeTol_;
static const scalar pointMergeTolDefault_;
//- Edge merge tolerance
static const scalar edgeMergeTol_;
static const scalar edgeMergeTolDefault_;
//- Estimated number of faces an edge goes through
static const label nFacesPerSlaveEdge_;
static const label nFacesPerSlaveEdgeDefault_;
//- Edge-face interaction escape limit
static const label edgeFaceEscapeLimit_;
static const label edgeFaceEscapeLimitDefault_;
//- Integral match point adjustment tolerance
static const scalar integralAdjTol_;
static const scalar integralAdjTolDefault_;
//- Edge intersection master catch fraction
static const scalar edgeMasterCatchFraction_;
static const scalar edgeMasterCatchFractionDefault_;
//- Edge intersection co-planar tolerance
static const scalar edgeCoPlanarTol_;
static const scalar edgeCoPlanarTolDefault_;
//- Edge end cut-off tolerance
static const scalar edgeEndCutoffTol_;
static const scalar edgeEndCutoffTolDefault_;
public:
@ -350,6 +376,8 @@ public:
//- Return projected points for a slave patch
const pointField& pointProjection() const;
//- Set the tolerances from the values in a dictionary
void setTolerances(const dictionary&, bool report=false);
//- Write
virtual void write(Ostream&) const;

View File

@ -26,22 +26,19 @@ License
#include "slidingInterface.H"
#include "polyMesh.H"
#include "primitiveMesh.H"
#include "line.H"
#include "triPointRef.H"
#include "plane.H"
#include "polyTopoChanger.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar Foam::slidingInterface::pointMergeTol_ = 0.05;
const Foam::scalar Foam::slidingInterface::edgeMergeTol_ = 0.01;
const Foam::label Foam::slidingInterface::nFacesPerSlaveEdge_ = 5;
const Foam::label Foam::slidingInterface::edgeFaceEscapeLimit_ = 10;
const Foam::scalar Foam::slidingInterface::pointMergeTolDefault_ = 0.05;
const Foam::scalar Foam::slidingInterface::edgeMergeTolDefault_ = 0.01;
const Foam::label Foam::slidingInterface::nFacesPerSlaveEdgeDefault_ = 5;
const Foam::label Foam::slidingInterface::edgeFaceEscapeLimitDefault_ = 10;
const Foam::scalar Foam::slidingInterface::integralAdjTol_ = 0.05;
const Foam::scalar Foam::slidingInterface::edgeMasterCatchFraction_ = 0.4;
const Foam::scalar Foam::slidingInterface::edgeEndCutoffTol_ = 0.0001;
const Foam::scalar Foam::slidingInterface::integralAdjTolDefault_ = 0.05;
const Foam::scalar Foam::slidingInterface::edgeMasterCatchFractionDefault_ = 0.4;
const Foam::scalar Foam::slidingInterface::edgeEndCutoffTolDefault_ = 0.0001;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -81,7 +81,10 @@ Foam::porousZone::porousZone
{
Info<< "Creating porous zone: " << name_ << endl;
if (cellZoneID_ == -1 && !Pstream::parRun())
bool foundZone = (cellZoneID_ != -1);
reduce(foundZone, orOp<bool>());
if (!foundZone && Pstream::master())
{
FatalErrorIn
(
@ -91,6 +94,7 @@ Foam::porousZone::porousZone
<< exit(FatalError);
}
// porosity
if (dict_.readIfPresent("porosity", porosity_))
{

View File

@ -70,7 +70,7 @@ oscillatingFixedValueFvPatchField<Type>::oscillatingFixedValueFvPatchField
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField<Type>(p, iF),
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
refValue_(ptf.refValue_, mapper),
amplitude_(ptf.amplitude_),
frequency_(ptf.frequency_),
@ -188,13 +188,12 @@ void oscillatingFixedValueFvPatchField<Type>::updateCoeffs()
template<class Type>
void oscillatingFixedValueFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
fixedValueFvPatchField<Type>::write(os);
refValue_.writeEntry("refValue", os);
os.writeKeyword("amplitude")
<< amplitude_ << token::END_STATEMENT << nl;
os.writeKeyword("frequency")
<< frequency_ << token::END_STATEMENT << nl;
this->writeEntry("value", os);
}

View File

@ -280,9 +280,8 @@ Foam::extendedCellToFaceStencil::calcDistributeMap
new mapDistribute
(
nCompact,
sendCompact,
recvCompact,
true // reuse send/recv maps.
sendCompact.xfer(),
recvCompact.xfer()
)
);

View File

@ -79,7 +79,6 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
<< " (Actual type " << actualTypeName_ << ")" << nl
<< "\n Please add the 'value' entry to the write function "
"of the user-defined boundary-condition\n"
" or link the boundary-condition into libfoamUtil.so"
<< exit(FatalIOError);
}

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "DispersionModel.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cloudAbsorptionEmission.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cloudScatter.H"

View File

@ -244,6 +244,7 @@ class PointEdgeWave
//- Disallow default bitwise assignment
void operator=(const PointEdgeWave&);
public:
// Static Functions
@ -261,7 +262,6 @@ public:
}
// Constructors
//- Construct from mesh, list of changed points with the Type

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "PointEdgeWave.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "pointEdgePoint.H"
@ -32,8 +30,6 @@ Description
Foam::point Foam::pointEdgePoint::greatPoint(GREAT, GREAT, GREAT);
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
@ -45,9 +41,11 @@ Foam::Ostream& Foam::operator<<
return os << wDist.origin() << wDist.distSqr();
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::pointEdgePoint& wDist)
{
return is >> wDist.origin_ >> wDist.distSqr_;
}
// ************************************************************************* //

View File

@ -45,7 +45,6 @@ SourceFiles
#include "tensor.H"
#include "pTraits.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
@ -69,6 +68,7 @@ class pointEdgePoint
//- normal distance (squared) from point to origin
scalar distSqr_;
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
@ -89,6 +89,7 @@ class pointEdgePoint
const scalar tol
);
public:
// Static data members
@ -96,6 +97,7 @@ public:
//- initial point far away.
static point greatPoint;
// Constructors
//- Construct null

View File

@ -111,6 +111,7 @@ inline bool Foam::pointEdgePoint::update
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellClassification.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellInfo.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellDistFuncs.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "wallPoint.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "wallPointData.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellFeatures.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Class calculates cell quality measures.
\*---------------------------------------------------------------------------*/

View File

@ -111,10 +111,7 @@ Foam::coordinateSystem::coordinateSystem
}
Foam::coordinateSystem::coordinateSystem
(
const dictionary& dict
)
Foam::coordinateSystem::coordinateSystem(const dictionary& dict)
:
name_(type()),
note_(),
@ -332,6 +329,7 @@ void Foam::coordinateSystem::writeDict(Ostream& os, bool subDict) const
}
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::coordinateSystem::operator=(const dictionary& rhs)

View File

@ -166,6 +166,7 @@ class coordinateSystem
//- Global-to-Local transformation tensor
tensor Rtr_;
protected:
// Protected Member Functions
@ -194,6 +195,7 @@ protected:
bool translate
) const;
public:
//- Runtime type information
@ -249,6 +251,7 @@ public:
return autoPtr<coordinateSystem>(new coordinateSystem(*this));
}
// Declare run-time constructor selection table
declareRunTimeSelectionTable
@ -276,6 +279,7 @@ public:
(name, origin, cr)
);
// Selectors
//- Select constructed from dictionary
@ -297,8 +301,8 @@ public:
//- Select constructed from Istream
static autoPtr<coordinateSystem> New(Istream& is);
// Destructor
//- Destructor
virtual ~coordinateSystem();
@ -394,6 +398,7 @@ public:
return origin_;
}
// Write
//- Write
@ -402,51 +407,60 @@ public:
//- Write dictionary
virtual void writeDict(Ostream&, bool subDict=true) const;
// Transformations
//- Convert from position in local coordinate system to global Cartesian position
//- Convert from position in local coordinate system to global
// Cartesian position
point globalPosition(const point& local) const
{
return localToGlobal(local, true);
}
//- Convert from position in local coordinate system to global Cartesian position
//- Convert from position in local coordinate system to global
// Cartesian position
tmp<pointField> globalPosition(const pointField& local) const
{
return localToGlobal(local, true);
}
//- Convert from vector components in local coordinate system to global Cartesian vector
//- Convert from vector components in local coordinate system to
// global Cartesian vector
vector globalVector(const vector& local) const
{
return localToGlobal(local, false);
}
//- Convert from vector components in local coordinate system to global Cartesian vector
//- Convert from vector components in local coordinate system to
// global Cartesian vector
tmp<vectorField> globalVector(const vectorField& local) const
{
return localToGlobal(local, false);
}
//- Convert from global Cartesian position to position in local coordinate system
//- Convert from global Cartesian position to position in local
// coordinate system
point localPosition(const point& global) const
{
return globalToLocal(global, true);
}
//- Convert from global Cartesian position to position in local coordinate system
//- Convert from global Cartesian position to position in local
// coordinate system
tmp<pointField> localPosition(const pointField& global) const
{
return globalToLocal(global, true);
}
//- Convert from global Cartesian vector to components in local coordinate system
//- Convert from global Cartesian vector to components in local
// coordinate system
vector localVector(const vector& global) const
{
return globalToLocal(global, false);
}
//- Convert from global Cartesian vector to components in local coordinate system
//- Convert from global Cartesian vector to components in local
// coordinate system
tmp<vectorField> localVector(const vectorField& global) const
{
return globalToLocal(global, false);
@ -467,6 +481,7 @@ public:
const coordinateSystem&
);
// IOstream Operators
friend Ostream& operator<<(Ostream&, const coordinateSystem&);

View File

@ -121,4 +121,5 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New
return New(name, dict);
}
// ************************************************************************* //

View File

@ -64,6 +64,7 @@ class coordinateSystems
//- Disallow default bitwise assignment
void operator=(const coordinateSystems&);
public:
//- Runtime type information
@ -88,11 +89,13 @@ public:
const Xfer<PtrList<coordinateSystem> >&
);
// Selectors
//- Return previously registered or read construct from "constant"
static const coordinateSystems& New(const objectRegistry&);
// Member Functions
//- Find and return index for a given keyword, returns -1 if not found

View File

@ -86,6 +86,7 @@ protected:
bool translate
) const;
public:
//- Runtime type information
@ -142,7 +143,6 @@ public:
//- Non-const access to inDegrees
bool& inDegrees();
};

View File

@ -159,6 +159,7 @@ Foam::vector Foam::parabolicCylindricalCS::globalToLocal
return vector::zero;
}
Foam::tmp<Foam::vectorField> Foam::parabolicCylindricalCS::globalToLocal
(
const vectorField& global,

View File

@ -85,6 +85,7 @@ protected:
bool translate
) const;
public:
//- Runtime type information
@ -106,7 +107,6 @@ public:
//- Construct from dictionary
parabolicCylindricalCS(const word&, const dictionary&);
};

View File

@ -85,6 +85,7 @@ protected:
bool translate
) const;
public:
//- Runtime type information
@ -141,7 +142,6 @@ public:
//- Non-const access to inDegrees
bool& inDegrees();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -171,4 +171,5 @@ void Foam::toroidalCS::writeDict(Ostream& os, bool subDict) const
}
}
// ************************************************************************* //

View File

@ -46,7 +46,6 @@ SourceFiles
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class toroidalCS Declaration
\*---------------------------------------------------------------------------*/
@ -86,6 +85,7 @@ class toroidalCS
bool translate
) const;
public:
//- Runtime type information
@ -103,7 +103,6 @@ public:
const scalar radius
);
//- Construct from dictionary
toroidalCS(const word& name, const dictionary&);

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "indexedOctree.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "treeDataPoint.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "octree.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "octreeDataCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
//#include "octreeDataPointTreeLeaf.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "octree.H"

View File

@ -22,9 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
IOList of pointIndexHits
\*---------------------------------------------------------------------------*/
#include "pointIndexHitIOList.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "treeLeaf.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "treeLeaf.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "treeNode.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "treeNode.H"

View File

@ -340,9 +340,8 @@ Foam::distributedTriSurfaceMesh::distributeSegments
new mapDistribute
(
segmentI, // size after construction
sendMap,
constructMap,
true // reuse storage
sendMap.xfer(),
constructMap.xfer()
)
);
}
@ -642,9 +641,8 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
new mapDistribute
(
segmentI, // size after construction
sendMap,
constructMap,
true // reuse storage
sendMap.xfer(),
constructMap.xfer()
)
);
const mapDistribute& map = mapPtr();
@ -806,9 +804,8 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
new mapDistribute
(
segmentI, // size after construction
sendMap,
constructMap,
true // reuse storage
sendMap.xfer(),
constructMap.xfer()
)
);
return mapPtr;
@ -2408,9 +2405,8 @@ void Foam::distributedTriSurfaceMesh::distribute
new mapDistribute
(
allTris.size(),
faceSendMap,
faceConstructMap,
true
faceSendMap.xfer(),
faceConstructMap.xfer()
)
);
pointMap.reset
@ -2418,9 +2414,8 @@ void Foam::distributedTriSurfaceMesh::distribute
new mapDistribute
(
allPoints.size(),
pointSendMap,
pointConstructMap,
true
pointSendMap.xfer(),
pointConstructMap.xfer()
)
);

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "boxToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "cellToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "faceToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "fieldToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "nearestToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "pointToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "rotatedBoxToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "shapeToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "surfaceToCell.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "boundaryToFace.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "boxToFace.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "faceToFace.H"

Some files were not shown because too many files have changed in this diff Show More